Let's perform the following steps:
- To work with Azure, install the Azure PowerShell module first, as follows:
Install-Module -Name Az -Scope CurrentUser
- Right now, starting any cmdlet will result in an error. Try it now, as follows:
Get-AzVm
- To begin working with Azure, you need to connect your account. Use Connect-AzAccount now—a login prompt will be displayed, as follows:
Connect-AzAccount
Simply follow the on-screen instructions, as shown in the following screenshot:
- If you have access to more than one subscription, select the right one, as per the following example:
Get-AzSubscription
- And use it with Set-AzContext ...