[Azure][PowerShell][ARM][01]Connect

连接

[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

posted @ 2017-05-26 17:36  wuzhenzhou  阅读(158)  评论(0编辑  收藏  举报