Get-AzEnvironment

In this Azure PowerShell article, we will discuss the syntax and usage of the Get-AzEnvironment Azure PowerShell cmdlet with examples of how to use the Get-AzEnvironment PowerShell command.

Get-AzEnvironment

Get-AzEnvironment is a very nice PowerShell command that can help you to retrieve the endpoints and the metadata for the instance of the Azure services. Let’s see the syntax of this command.

Syntax

Below is the syntax of the Get-AzEnvironment PowerShell command.

Get-AzEnvironment
Get-AzEnvironment [[-Name] <String>]

Example-1:

Execute the below PowerShell command that can help you with the endpoints and metadata information of the default Azure environments.

Get-AzEnvironment

After executing the above command, I got the below output.

PS C:\WINDOWS\system32> Get-AzEnvironment

Name              Resource Manager Url                  ActiveDirectory Authority     
----              --------------------                  -------------------------     
AzureChinaCloud   https://management.chinacloudapi.cn/  https://login.chinacloudapi...
AzureCloud        https://management.azure.com/         https://login.microsoftonli...
AzureUSGovernment https://management.usgovcloudapi.net/ https://login.microsoftonli...

You can see the same output here as below

Get-AzEnvironment

Example-2:

You can execute the below Azure PowerShell cmdlet to retrieve the endpoints and metadata information of the AzureChinaCloud environment.

Get-AzEnvironment -Name AzureChinaCloud

After executing the above command, I got the below output.

PS C:\WINDOWS\system32> Get-AzEnvironment -Name AzureChinaCloud

Name            Resource Manager Url                 ActiveDirectory Authority       T
                                                                                     y
                                                                                     p
                                                                                     e
----            --------------------                 -------------------------       -
AzureChinaCloud https://management.chinacloudapi.cn/ https://login.chinacloudapi.cn/ B

You can see the same output as below

Get-AzEnvironment PowerShell

Get-AzEnvironment – Video Tutorial

You may also like following the articles below

Wrapping Up

In this Azure PowerShell article, we discussed the syntax and usage of the Get-AzEnvironment PowerShell command with examples of how to use the Get-AzEnvironment command. Thanks for reading this example !!!