连接
[Azure Resource Management]
Add-AzureRmAccount -EnvironmentName AzureChinaCloud
# Get-AzureRmEnvironment | select Name Get-AzureRmEnvironment | select Name
或者
$cred = Get-Credential
Login-AzureRmAccount -EnvironmentName AzureChinaCloud -Credential $cred
# Get-Alias -Name Login-AzureRMAccount | Format-List -Property *
# https://github.com/Azure/azure-powershell/blob/dev/src/ResourceManager/Profile/Commands.Profile/Account/AddAzureRmAccount.cs#L32-L33
自动登录
Save-AzureRmProfile -Path "c:AzureProfile.json"
Set-AzureRmContext -SubscriptionName "订阅名称"
Select-AzureRmProfile -Path "c:AzureProfile.json"
步骤4:订阅
Get-AzureRmSubscription | select SubscriptionId, SubscriptionName