1、安装。
MSI安装程序:https://aka.ms/installazurecliwindows
https://docs.microsoft.com/zh-cn/cli/azure/install-azure-cli-windows?view=azure-cli-latest
检查安装,在PS里面能检查到Az命令
C:\Users\HuipingSheng>az -v
azure-cli 2.17.1
core 2.17.1
telemetry 1.0.6
2: 登入: az login
3、列出所有订阅
C:\Users\HuipingSheng>az account list --output table
Name CloudName SubscriptionId State IsDefault
-------------------- ----------- ------------------------------------ ------- -----------
Azure subscription 1 AzureCloud 6e6dc90b-3b39-4ca2-a12b-c3736df0139f Enabled True
即用即付 AzureCloud 6842d519-3c4d-4d83-924b-2bf724434e8e Enabled False
4、切换当前默认活动订阅
C:\Users\HuipingSheng>az account set --subscription "6842d519-3c4d-4d83-924b-2bf724434e8e"
C:\Users\HuipingSheng>az account list --output table
Name CloudName SubscriptionId State IsDefault
-------------------- ----------- ------------------------------------ ------- -----------
Azure subscription 1 AzureCloud 6e6dc90b-3b39-4ca2-a12b-c3736df0139f Enabled False
即用即付 AzureCloud 6842d519-3c4d-4d83-924b-2bf724434e8e Enabled True
5: 还有很多命令可以参考: