您现在访问的是微软AZURE全球版技术文档网站，若需要访问由世纪互联运营的MICROSOFT AZURE中国区技术文档网站，请访问 https://docs.azure.cn.
Quickstart: Connect to Azure Government with PowerShell
Microsoft Azure Government delivers a dedicated cloud with world-class security and compliance, enabling US government agencies and their partners to transform their workloads to the cloud. To manage your Azure Government cloud workloads and applications you can connect to the Azure Government using different tools, as described in the following video.
This quickstart shows how to use PowerShell to access and start managing resources in Azure Government.
If you don't have an Azure Government subscription, create a free account before you begin.
This article has been updated to use the new Azure PowerShell Az module. You can still use the AzureRM module, which will continue to receive bug fixes until at least December 2020. To learn more about the new Az module and AzureRM compatibility, see Introducing the new Azure PowerShell Az module. For Az module installation instructions, see Install Azure PowerShell.
- Review Guidance for developers.
This article discusses Azure Government's unique URLs and endpoints for managing your environment. You must know about these endpoints in order to connect to Azure Government.
- Review Compare Azure Government and global Azure and click on a service of interest to see variations between Azure Government and global Azure.
Install PowerShell on your local machine. For more information, check out the Introduction to Azure PowerShell.
In Azure Government, there is no equivalent to Azure Cloud Shell that you can find in the Azure portal.
Specifying Azure Government as the environment to connect to
When you start PowerShell, you have to tell Azure PowerShell to connect to Azure Government by specifying an environment parameter. The parameter ensures that PowerShell is connecting to the correct endpoints. The collection of endpoints is determined when you connect log in to your account. Different APIs require different versions of the environment switch:
|Azure Active Directory commands||
|Azure (Classic deployment model) commands||
|Azure Active Directory (Classic deployment model) commands||
Get current regions
To list the available regions in Azure Government, run the following commands and print the current list:
Get-AzLocation Get-AzureLocation # For classic deployment model
The Azure Government region display names have no spaces between
DoD when using the
|Common Name||Display Name||Location Name|
|US Gov Virginia||
|US Gov Iowa||
|US Gov Texas||
|US Gov Arizona||
|US DoD East||
|US DoD Central||
This quickstart showed you how to use PowerShell to connect to Azure Government. Once you are connected to Azure Government, you may want to explore Azure services. Make sure you check out the variations, described in Compare Azure Government and global Azure. To learn more about Azure services continue to the Azure documentation.