How To: Use the Azure CLI with Azure Government


UPDATE: official documentation on how to do this can be found here

The Azure CLI provides a cross platform command line interface for working with Azure. If you are on Windows you might want to take a look at PowerShell, see Ryan’s post here on how to configure that.

  • Install the CLI
    • Follow the instructions here. Be sure to get the latest version of the CLI (later than 0.9.13). In this version we added the environment settings for Azure Gov (Environment name: “AzureUSGovernment”)
  • You have two options you can login with a username/password or you can login with a Publish Settings File
  • If you choose username/password use the following command replacing your info
  • If you choose Publish Settings File
    • Download the publish settings file for your Azure Government Subscription
    • Connect it to your subscription
      • Execute this command (replacing the path you downloaded publish settings file to and the name it was given)

 

You should now have access to everything via the CLI from any platform.

Comments (0)

Skip to main content