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 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 uses the Azure Az PowerShell module, which is the recommended PowerShell module for interacting with Azure. To get started with the Az PowerShell module, see Install Azure PowerShell. To learn how to migrate to the Az PowerShell module, see Migrate Azure PowerShell from AzureRM to Az.


  • 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

Install PowerShell on your local machine. For more information, check out the Introduction to Azure PowerShell.

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:

Connection type Command
Azure commands Connect-AzAccount -EnvironmentName AzureUSGovernment
Azure Active Directory commands Connect-AzureAD -AzureEnvironmentName AzureUSGovernment
Azure (Classic deployment model) commands Add-AzureAccount -Environment AzureUSGovernment
Azure Active Directory (Classic deployment model) commands Connect-MsolService -AzureEnvironment UsGovernment

Connect to Azure Government

Get current regions

To list the available regions in Azure Government, run the following commands and print the current list:


Get-AzureLocation # For classic deployment model 


The Azure Government region display names have no spaces between US and Gov or US and DoD when using the Location parameter.

Common Name Display Name Location Name
US Gov Virginia USGov Virginia usgovvirginia
US Gov Texas USGov Texas usgovtexas
US Gov Arizona USGov Arizona usgovarizona
US DoD East USDoD East usdodeast
US DoD Central USDoD Central usdodcentral

Next steps

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 feature variations and usage limitations, described in Compare Azure Government and global Azure. To learn more about Azure services, continue to the Azure documentation.