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.
Table of Contents
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

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 – 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 !!!

I am Rajkishore, and I have over 14 years of experience in Microsoft Azure and AWS, with good experience in Azure Functions, Storage, Virtual Machine, Logic Apps, PowerShell Commands, CLI Commands, Machine Learning, AI, Azure Cognitive Services, DevOps, etc. Not only that, I do have good real-time experience in designing and developing cloud-native data integrations on Azure or AWS, etc. I hope you will learn from these practical Azure tutorials. Read more.