Connect to Azure using PowerShell

Source: Internet
Author: User

In addition to using the portal to log in, you can also use PowerShell to connect to Azure.
The first thing to do is download the components

Http://azure.microsoft.com/en-us/downloads/?rnd=1

http://www.windowsazure.cn/downloads/#cmd-line-tools

One is the international version, one is the domestic version, the same tool version.

The integrated installation via the Web Platform Installer will actually install some components depending on the operating system, and the following are the parts that need to be installed under window 10

See if you have this module

PS c:\windows\system32> get-module-listavailable Azure    directory:c:\program Files (x86) \microsoft SDKs\ Azure\powershell\servicemanagementmoduletype Version    Name                                exportedcommands-----------------    -- -                                -----------------   Manifest0.8.11     Azure                               {disable-azureserviceprojectremotedesktop, enable-Azuremem ... PS C:\Windows\system32>

Add an Azure account in the China region

Add-azureaccount-enviroment Azurechinacloud

It is possible to get this statement by this method

get-help add-azureaccount-Examples    --------------------------  5 in Azure China  --------------------------    PS C: >add-azureaccount-environment Azurechinacloud This    command uses the environment parameter to add a to Windows PowerShell for Azure China account. When you run    the command, a Windows pops up to request the user name and password of the account.

To query this sentence.

Add an international version of Azure account

Add-azureaccount

Please keep all lowercase in the input account.
Get the added account and subscription information. (SubscriptionId deleted)

PS c:\windows\system32> get-AzureSubscriptionSubscriptionId:SubscriptionName:MSDNEnvironment:AzureCloudSupp Ortedmodes:azureservicemanagement,azureresourcemanagerdefaultaccount:anderson.ling@outlook.comaccounts: {anderson.ling@Outlook.com} IsDefault:Trueiscurrent:TrueCurrentStorageAccountName:SubscriptionId:SubscriptionName:PayEnvironment:Azur EChinaCloudSupportedModes:AzureServiceManagementDefaultAccount:Andreson@signalTips.partner.onmschina.cnAccounts: {Andreson@signalTips.partner.onmschina.cn} IsDefault:Falseiscurrent:FalseCurrentStorageAccountName:SubscriptionId:SubscriptionName:FreeEnvironment:Azu ReChinaCloudSupportedModes:AzureServiceManagementDefaultAccount:Ling@SHTriathlon.partner.onmschina.cnAccounts: {Ling@SHTriathlon.partner.onmschina.cn} IsDefault:Falseiscurrent:FalseCurrentstorageaccountname:
View Code

Can be based on this article

Http://www.cnblogs.com/threestone/p/4001943.html

Modify Subscription Name

Can get the current subscription account

PS c:\windows\system32> get-azuresubscription-currentsubscriptionid            : subscriptionname          : Freeenvironment:               azurechinacloudsupportedmodes            : Azureservicemanagementdefaultaccount            : Ling@ SHTriathlon.partner.onmschina.cnAccounts                  : {Ling@Shtriathlon.partner.onmschina.cn}isdefault                  False iscurrent                  True Currentstorageaccountname:

You can switch to the subscription account by Subscriptionname,subscriptionid

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:

International edition can add multiple subscriptions in one subscription, mooncake version does not develop this feature

Azure Traffic Manager is now available in the Chinese version of Azure

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/

Connect to Azure using PowerShell

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.