New Environments Added to Azure PowerShell

In the 1.1.0 version of the Azure PowerShell tools new environments have been added to make it easier for using Azure US Government, Azure China, or Azure Commercial environments.   Previously in order to use either Azure US Government or Azure China you had to manually set Azure environment variables in order for the standard Azure PowerShell cmdlets to work.  An example of this is shown in a prior blog post I wrote on how to connect PowerShell to Azure US Government.

Now the following Azure Environment definitions are available by default with Azure PowerShell:

  • AzureCloud:  Azure Commercial
  • AzureChinaCloud:   Azure China
  • AzureUSGovernment: Azure US Government

With the new Azure PowerShell tools you can easily switch between environments using the following cmdlet:  Set-AzureEnvironment

Now if we wish to connect to the Azure US Government cloud we would utilize the following cmdlet:

  1. Add-AzureAccount –Environment “AzureUSGovernment”

You can then select your Azure Subscription using Select-AzureSubscription and then begin exectuing other Azure PowerShell cmdlets.

With this new addition to the Azure PowerShell tools, connecting to and using Azure US Government or Azure China is a lot easier.

Leave a Reply