September 29th, 2015
0 reactions

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

azure login --username "name@domain.onmicrosoft.com" --password "password" --environment "AzureUSGovernment"
view raw gistfile1.txt hosted with ❤ by GitHub

  • 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)

azure account import "C:\<<Path to your file>\<<your filename>>.publishsettings"
view raw gistfile1.txt hosted with ❤ by GitHub

 

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

Topics
CLI

0 comments

Discussion is closed.