Gets Azure environments


   [-Name <String>]
   [-Profile <AzureSMProfile>]


The Get-AzureEnvironment cmdlet gets the Azure environments that are available to Windows PowerShell.

An Azure environment an independent deployment of Microsoft Azure, such as AzureCloud for global Azure and AzureChinaCloud for Azure operated by 21Vianet in China. You can also create on-premises Azure environments by using Azure Pack and the WAPack cmdlets. For more information, see Azure Pack (

The Get-AzureEnvironment cmdlet gets environments from your subscription data file, not from Azure. If the subscription data file is outdated, run the Add-AzureAccount or Import-PublishSettingsFile cmdlet to refresh it.

This topic describes the cmdlet in the 0.8.10 version of the Microsoft Azure PowerShell module. To get the version of the module you're using, in the Azure PowerShell console, type (Get-Module -Name Azure).Version.


Example 1: Get all environments

PS C:\> Get-AzureEnvironment

EnvironmentName               ServiceEndpoint               ResourceManagerEndpoint       PublishSettingsFileUrl
---------------               ---------------               -----------------------       ----------------------

AzureCloud                    https://management.core.wi... 
AzureChinaCloud      https://not-supported-serv...

This command gets all environments that are available to Windows PowerShell.

Example 2: Get an environment by name

PS C:\> Get-AzureEnvironment -Name AzureCloud

Name                          : AzureCloud

PublishSettingsFileUrl        :

ServiceEndpoint               :

ResourceManagerEndpoint       :

ManagementPortalUrl           :

ActiveDirectoryEndpoint       :

ActiveDirectoryCommonTenantId : common

StorageEndpointSuffix         :

StorageBlobEndpointFormat     : {0}://{1}

StorageQueueEndpointFormat    : {0}://{1}

StorageTableEndpointFormat    : {0}://{1}

GalleryEndpoint               :

This example gets the AzureCloud environment.

Example 3: Get all properties of all environments

PS C:\> Get-AzureEnvironment | ForEach-Object {Get-AzureEnvironment -Name $_.EnvironmentName}

This command gets all properties of all environments.

The command uses the Get-AzureEnvironment cmdlet to get all Azure environments for this account. Then, it uses the Foreach-Object cmdlet to run a Get-AzureEnvironment command with the Name parameter on each environment. The value of the Name parameter is the EnvironmentName property of each environment.

Without parameters, Get-AzureEnvironment gets only selected properties of an environment.

Optional Parameters


Gets only the specified environment. Type the environment name. The parameter value is case-sensitive. Wildcard characters are not permitted.

Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False

Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile.

Default value:None
Accept pipeline input:False
Accept wildcard characters:False



You can pipe input to this cmdlet by property name, but not by value.



By default, Get-AzureEnvironment returns a custom object.



When you run Get-AzureEnvironment with the Name parameter, it returns a WindowsAzureEnvironment object.