PS c:\windows\system32> import-azurepublishsettingsfile ' C:\Users\Ling\Desktop\Free-11-24-2014- Credentials.publishsettings ' Id : 36b1bd18-6519-4ea5-8d90-5300a6915a25name : freeenvironment: Azurechinacloudaccount : 5499b16b9fec1df8608cdproperties : {[Supportedmodes, Azureservicemanagement]}ps C : \Windows\System32>
First, please refer to how to use Add-azureaccount to join an account
Http://www.cnblogs.com/SignalTips/p/4106248.html
This article describes how to use the Join account to access Azure using PowerShell.
If there are multiple subscriptions, how to switch, how to add a subscription, how to change the default subscription.
1. How to switch between different subscriptions
PS c:\windows\system32> select-azuresubscription-subscriptionname payps C:\WINDOWS\system32> Get-azuresubscription-Currentsubscriptionid : subscriptionname : payenvironment : Azurechinacloudsupportedmodes : Azureservicemanagementdefaultaccount : Andreson@ SignalTips.partner.onmschina.cnAccounts : {andreson@Signaltips.partner.onmschina.cn}isdefault False iscurrent True Currentstorageaccountname:
How to get the subscription name
PS c:\windows\system32> get-AzureSubscriptionSubscriptionId:SubscriptionName:MSDNEnvironment:AzureCloudSup Portedmodes:azureservicemanagement,azureresourcemanagerdefaultaccount:anderson.ling@outlook.comaccounts: {anderson.ling@Outlook.com,} IsDefault:Falseiscurrent:FalseCurrentStorageAccountName:SubscriptionId:SubscriptionName:PayEnvironment:Azur EChinaCloudSupportedModes:AzureServiceManagementDefaultAccount:Andreson@signalTips.partner.onmschina.cnAccounts: {Andreson@signalTips.partner.onmschina.cn} IsDefault:Falseiscurrent:TrueCurrentStorageAccountName:SubscriptionId:SubscriptionName:FreeEnvironment:Azu ReChinaCloudSupportedModes:AzureServiceManagementDefaultAccount:Ling@SHTriathlon.partner.onmschina.cnAccounts: {Ling@SHTriathlon.partner.onmschina.cn,} IsDefault:Trueiscurrent:FalseCurrentstorageaccountname:
2. How to add a subscription
Switch to the account you want to get your subscription to,
PS c:\windows\system32> Select-azuresubscription-subscriptionname
Use the following command, or switch to the Download Certified Web page
PS c:\windows\system32> Get-azurepublishsettingsfile
After downloading, use the following methods to import the certificate
You can view the following information under Settings
Using PowerShell Add, select Change Subscription