{"id":331,"date":"2015-09-29T15:34:00","date_gmt":"2015-09-29T15:34:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/azuregov\/2015\/09\/29\/how-to-use-the-azure-cli-with-azure-government\/"},"modified":"2019-03-28T22:36:23","modified_gmt":"2019-03-29T05:36:23","slug":"how-to-use-the-azure-cli-with-azure-government","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/azuregov\/how-to-use-the-azure-cli-with-azure-government\/","title":{"rendered":"How To: Use the Azure CLI with Azure Government"},"content":{"rendered":"<h3>UPDATE: official documentation on how to do this can be found <a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/azure-government\/documentation-government-get-started-connect-with-cli\">here<\/a><\/h3>\n<p>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&rsquo;s post <a href=\"http:\/\/blogs.msdn.com\/b\/azuregov\/archive\/2015\/03\/24\/get-started-with-powershell-on-azure-government.aspx\">here<\/a> on how to configure that.<\/p>\n<ul>\n<li>Install the CLI\n<ul>\n<li>Follow the instructions <a href=\"https:\/\/azure.microsoft.com\/en-us\/documentation\/articles\/xplat-cli-install\/\">here<\/a>. 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: &#8220;AzureUSGovernment&#8221;)<\/li>\n<\/ul>\n<\/li>\n<li>You have two options you can login with a <strong>username\/password<\/strong> or you can login with a <strong>Publish Settings File<\/strong><\/li>\n<li>If you choose <strong>username\/password<\/strong> use the following command replacing your info<\/li>\n<\/ul>\n<p><script type=\"text\/javascript\" src=\"https:\/\/gist.github.com\/shawnweisfeld\/da324966d6ae966ea7ec.js\"><\/script><\/p>\n<ul>\n<li>If you choose <strong>Publish Settings File<\/strong><\/li>\n<ul>\n<li>\n<div>Download the publish settings file for your Azure Government Subscription<\/div>\n<ul>\n<li>Using an InPrivate browser window, log into the <a href=\"https:\/\/manage.windowsazure.us\">Azure Government Management Portal<\/a><\/li>\n<li>Don&#8217;t forget to use your something.onmicrosoft.com username and be sure to select &#8220;work or school account&#8221;<\/li>\n<li>After you have logged in navigate to the following URL in the same browser window. <a href=\"https:\/\/manage.windowsazure.us\/publishsettings\/index\">https:\/\/manage.windowsazure.us\/publishsettings\/index<\/a><\/li>\n<li>This will trigger the download of a file, you will need its name and location for the next step<\/li>\n<\/ul>\n<\/li>\n<li>Connect it to your subscription\n<ul>\n<li>Execute this command (replacing the path you downloaded publish settings file to and the name it was given)<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/ul>\n<p><script type=\"text\/javascript\" src=\"https:\/\/gist.github.com\/shawnweisfeld\/8fb199bf312d4d20650b.js\"><\/script><\/p>\n<p>&nbsp;<\/p>\n<p>You should now have access to everything via the CLI from any platform.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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&rsquo;s post here on how to configure that. Install the CLI Follow the instructions [&hellip;]<\/p>\n","protected":false},"author":5375,"featured_media":20423,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[168],"class_list":["post-331","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-azuregov","tag-cli"],"acf":[],"blog_post_summary":"<p>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&rsquo;s post here on how to configure that. Install the CLI Follow the instructions [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/azuregov\/wp-json\/wp\/v2\/posts\/331","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/azuregov\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/azuregov\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/azuregov\/wp-json\/wp\/v2\/users\/5375"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/azuregov\/wp-json\/wp\/v2\/comments?post=331"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/azuregov\/wp-json\/wp\/v2\/posts\/331\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/azuregov\/wp-json\/wp\/v2\/media\/20423"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/azuregov\/wp-json\/wp\/v2\/media?parent=331"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/azuregov\/wp-json\/wp\/v2\/categories?post=331"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/azuregov\/wp-json\/wp\/v2\/tags?post=331"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}