Use the following steps to log in to the Azure CLI:
- Open a Command Prompt and use the following command to log in to the Azure CLI:
Figure 8. Azure CLI login
- It will prompt a browser where you can pick your Azure account for login.
Figure 9. Pick an account to log in
- After you successfully log in with your Azure account, your subscriptions will appear in the Azure CLI output:
Figure 10. Login output
If you have multiple Azure subscriptions, ensure that the default subscription settings match where you want the deployment to occur. Use the following steps to set a default subscription:
- At a Command Prompt, use the following command to set the default Azure subscription. Replace the subscription ID in the parameter with the one you want to use. You can easily find the ID in the login output shown in Figure 10.
>az account set --subscription=<your default subscription ID>
- Use the following command to verify whether the target subscription has been set to default. You can find the field - isDefault is set to true.
>az account list
Figure 11. Set default Azure Subscription