除了使用門戶登入外,還可以使用PowerShell的方式來連接Azure。
首先要去下載組件
http://azure.microsoft.com/en-us/downloads/?rnd=1
http://www.windowsazure.cn/downloads/#cmd-line-tools
一個是國際版的,一個是國內版,工具版本相同。
通過Web Platform Installer 來集成安裝其實會根據不同操作系統安裝一些組件,以下是在Window 10下需要安裝的部分
查看是否有這個module
PS C:\Windows\system32> Get-Module -ListAvailable Azure Directory: C:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell\ServiceManagement ModuleType Version Name ExportedCommands ---------- ------- ---- ---------------- Manifest 0.8.11 Azure {Disable-AzureServiceProjectRemoteDesktop, Enable-AzureMem... PS C:\Windows\system32>
添加一個中國地區的Azure賬號
add-azureaccount -Enviroment AzureChinaCloud
可以通過這樣的方法來獲取這個語句
PS C:\WINDOWS\system32> get-help add-AzureAccount -Examples -------------------------- Example 5: Add an account in Azure China -------------------------- PS C:\>Add-AzureAccount -Environment AzureChinaCloud This command uses the Environment parameter to add an Azure China account to Windows PowerShell. When you run the command, a windows pops up to request the user name and password of the account.
來查詢到此句語句
添加一個國際版本的Azure賬號
add-azureaccount
輸入賬號請保持全部小寫。
獲取添加的賬號以及訂閱信息。(SubscriptionId已刪除)

PS C:\WINDOWS\system32> Get-AzureSubscription SubscriptionId : SubscriptionName : MSDN Environment : AzureCloud SupportedModes : AzureServiceManagement,AzureResourceManager DefaultAccount : anderson.ling@outlook.com Accounts : {anderson.ling@outlook.com} IsDefault : True IsCurrent : True CurrentStorageAccountName : SubscriptionId : SubscriptionName : Pay Environment : AzureChinaCloud SupportedModes : AzureServiceManagement DefaultAccount : Andreson@signalTips.partner.onmschina.cn Accounts : {Andreson@signalTips.partner.onmschina.cn} IsDefault : False IsCurrent : False CurrentStorageAccountName : SubscriptionId : SubscriptionName : Free Environment : AzureChinaCloud SupportedModes : AzureServiceManagement DefaultAccount : Ling@SHTriathlon.partner.onmschina.cn Accounts : {Ling@SHTriathlon.partner.onmschina.cn} IsDefault : False IsCurrent : False CurrentStorageAccountName :
可以根據這篇文章
http://www.cnblogs.com/threestone/p/4001943.html
修改訂閱名稱
可以獲取當前訂閱賬戶
PS C:\WINDOWS\system32> Get-AzureSubscription -Current SubscriptionId : SubscriptionName : Free Environment : AzureChinaCloud SupportedModes : AzureServiceManagement DefaultAccount : Ling@SHTriathlon.partner.onmschina.cn Accounts : {Ling@SHTriathlon.partner.onmschina.cn} IsDefault : False IsCurrent : True CurrentStorageAccountName :
可以通過來切換訂閱賬號SubscriptionName,SubscriptionId
PS C:\WINDOWS\system32> Select-AzureSubscription -SubscriptionName Pay PS C:\WINDOWS\system32> Get-AzureSubscription -Current SubscriptionId : SubscriptionName : Pay Environment : AzureChinaCloud SupportedModes : AzureServiceManagement DefaultAccount : Andreson@signalTips.partner.onmschina.cn Accounts : {Andreson@signalTips.partner.onmschina.cn} IsDefault : False IsCurrent : True CurrentStorageAccountName :
國際版可以在一個訂閱中添加中多個訂閱,mooncake版本不開發此項功能
中國版 Azure 現提供 Azure Traffic Manager
http://blogs.msdn.com/b/azchina/archive/2014/10/13/azure-traffic-manager-in-azure-in-china.aspx
How to install and configure Azure PowerShell
http://azure.microsoft.com/en-us/documentation/articles/install-configure-powershell/