There are other ways to leverage the power of command-driven infrastructure manipulation within Azure. In this video, learn the basics of how PowerShell can be used to create and edit Azure resources.
- [Instructor] We're going to take a look at PowerShell, and PowerShell, I want to give you a definition. It's a comprehensive command-line interface and scripting language for Windows. Now, let me tell you some of the benefits of using the PowerShell. One, this thing is massive. It has massive built-in functionality. Almost anything you can do with Microsoft Azure, you can do through the PowerShell. It can work with Linux now. Microsoft has been embracing Linux as an operating system lately. It uses an existing well-used platform. This has been around since 2006. You can even say that Windows was built on PowerShell. So it's gone through several iterations, and it is very well established. You can use modules, and what these modules do, is they expand the functionality of the PowerShell. If you open up PowerShell with any Windows, you can put in a module for the actual Azure. Now, when to use Azure PowerShell. When you're performing complex operations, pretty much your only option is actually to use PowerShell for that. It's not going to work with the Azure CLI, and it's not going to work with the portal itself. We need to use variables, and I'm going to show you what a variable is, and how to use that little bit later on, because PowerShell really is a scripting language, and it is the closest thing that we have to a regular programming language where you need to use variables. If you're repeating operations, then PowerShell is very convenient. Some of these scripts can get very, very long, so with that script, you're going to be repeating that script several times. If you already have a background in PowerShell, then it's highly recommended that you just go ahead and use PowerShell. PowerShell is built on these, they're called commandlets. These are specialized sentences, which implement a particular operation. Let's take a look at a commandlet. That first one there is the Syntax. What you have is a verb and a noun. A verb is what do you want to do, a noun is what do you want to do at two. And that is the core of a commandlet. And then you have a dash, a required parameter, a dash, then a word, and an optional parameter, and then you have a dash and a global parameter. And here's some examples. See this one, Get-AzResouceGroup. If I type that in, what's going to happen is, it's going to give me all the resource groups that I have for a particular subscription. The optional parameter would be location as you see with the next one, Get-AzResourceGroup -location westus, and just by examining this, just by inspection, you can see that this is going to give me all the resource groups in the westus location. Now, a little more complicated commandlet, New-azvm. We want to create a new Azure virtual machine. We need to give it a name, we need to tell it what resource group it's going to belong to, and then we have the location and how we're going to use the credential for the actual username and password inside the operating system. So that is a quick look at what PowerShell is in Microsoft Azure.
- Customizing the Azure portal
- Creating and deploying resources
- Using the Azure CLI
- Deploying and configuring resources with the CLI
- Deploying and configuring resources with PowerShell
- Deploying resources with JSON templates