您现在访问的是微软AZURE全球版技术文档网站，若需要访问由世纪互联运营的MICROSOFT AZURE中国区技术文档网站，请访问 https://docs.azure.cn.
Quickstart: Connect to Azure Government with Azure CLI
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 the Azure CLI 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.
- 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 Azure CLI
Install the Azure CLI locally by following the instructions in Install the Azure CLI.
In Azure Government, there is no equivalent to Azure Cloud Shell that you can find in the Azure portal.
Connect with Azure CLI
Connect to Azure Government by setting the cloud with the name
az cloud set --name AzureUSGovernment
Once the cloud has been set, you can continue logging in:
When you type
login, a browser is launched for you to log in. Choose your Azure Government account and log in with appropriate credentials.
To confirm the cloud has correctly been set to
az cloud list --output table
isActive flag for the
AzureUSGovernment item should be set to
List US Government regions
You use the same command as for global Azure.
az account list-locations
This quickstart showed you how to use CLI 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.