{"id":1824,"date":"2013-05-10T03:05:44","date_gmt":"2013-05-10T03:05:44","guid":{"rendered":"https:\/\/pipe2text.com\/?page_id=1824"},"modified":"2013-05-20T00:24:55","modified_gmt":"2013-05-20T00:24:55","slug":"setting-up-azure-powershell-and-connecting-it-to-your-azure-subscriptions","status":"publish","type":"page","link":"https:\/\/pipe2text.com\/?page_id=1824","title":{"rendered":"Setting up Azure PowerShell and connecting it to your Azure Subscriptions"},"content":{"rendered":"<p>Start by installing Azure PowerShell on your system. I have it installed on a Windows 2008 r2 server and a Windows 7 laptop, it works fine on either. The install files can be found at the following location.<\/p>\n<p><a href=\"http:\/\/www.windowsazure.com\/en-us\/downloads\/?fb=en-us\">http:\/\/www.windowsazure.com\/en-us\/downloads\/?fb=en-us<\/a><\/p>\n<p>When you open the website browse to the area below and go to the \u201cCommand Line Tools\u201d area. Click on the Windows Azure Powershell icon. Depending on the status of your system it may require a reboot or two.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" style=\"display: inline;\" alt=\"\" src=\"https:\/\/pipe2text.com\/wp-content\/plugins..\/..\/uploads\/media\/setting-up-azure-powershell-and-connecting-it-to-you\/image1.png\" width=\"541\" height=\"228\" \/><\/p>\n<p>Once everything is installed you can go to Start -&gt; Programs and open Windows Azure PowerShell<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" style=\"display: inline;\" alt=\"\" src=\"https:\/\/pipe2text.com\/wp-content\/plugins..\/..\/uploads\/media\/setting-up-azure-powershell-and-connecting-it-to-you\/image2.png\" width=\"233\" height=\"91\" \/><\/p>\n<p>It will open up a PowerShell command prompt and look like this.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" style=\"display: inline;\" alt=\"\" src=\"https:\/\/pipe2text.com\/wp-content\/plugins..\/..\/uploads\/media\/setting-up-azure-powershell-and-connecting-it-to-you\/image3.png\" width=\"598\" height=\"237\" \/><\/p>\n<p>First step is to type the following command<\/p>\n<p>Import-Module &#8220;C:\\Program Files (x86)\\Microsoft SDKs\\Windows Azure\\PowerShell\\Azure\\Azure.psd1&#8221;<\/p>\n<p>Running it will look like the following. It will import all the necessary modules in.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" style=\"display: inline;\" alt=\"\" src=\"https:\/\/pipe2text.com\/wp-content\/plugins..\/..\/uploads\/media\/setting-up-azure-powershell-and-connecting-it-to-you\/image4.png\" width=\"598\" height=\"367\" \/><\/p>\n<p>Next step will be to get a copy of the Azure publishing file. When you run the following command it will bring you to an Azure login page.<\/p>\n<p>PS C:&gt; Get-AzurePublishSettingsFile<\/p>\n<p>When the page opens you will need to log in with your Azure ID and the following page will appear. There will be a file download prompt at the bottom of the site. The file will be called something like \u201cSubscriptionA- SubscriptionB- SubscriptionC-5-05-2013-credentials.publishsetting\u201d. Save the file to the location of your choice.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" style=\"display: inline;\" alt=\"\" src=\"https:\/\/pipe2text.com\/wp-content\/plugins..\/..\/uploads\/media\/setting-up-azure-powershell-and-connecting-it-to-you\/image5.png\" width=\"550\" height=\"217\" \/><\/p>\n<p>After you\u2019ve saved the file to your system run the following command to import it. Once the file imports you will have connectivity from PowerShell to your Azure subscription.<\/p>\n<p><strong>PS <\/strong><strong>C:<\/strong><strong>&gt; Import-<\/strong><strong>AzurePublishSettingsFile<\/strong><strong> c:\\location\\<\/strong><strong>file<\/strong><strong>name.<\/strong><strong>publishsettings<\/strong><\/p>\n<p>The results will look like this.<\/p>\n<p><strong>PS <\/strong><strong>C:<\/strong><strong>&gt; Import-<\/strong><strong>AzurePublishSettingsFile<\/strong><strong> C:\\files\\<\/strong><strong>SubscriptionA<\/strong><strong>&#8211; <\/strong><strong>SubscriptionB<\/strong><strong>&#8211; SubscriptionC-5-05-2013-credentials.publishsettings<\/strong><\/p>\n<p><strong>VERBOSE: Setting: <\/strong><strong>SubscriptionA<\/strong><strong> as the default and current subscription. <\/strong><strong>T<\/strong><strong>o view other subscri<\/strong><strong>ptions use <\/strong><strong>Get-<\/strong><strong>AzureSubscription<\/strong><\/p>\n<p>Running the following command will list the details of all your Azure subscriptions<\/p>\n<p><strong>PS <\/strong><strong>C:<\/strong><strong>&gt; Get-<\/strong><strong>AzureSubscription<\/strong><\/p>\n<p>SubscriptionName : <strong>SubscriptionA<\/strong><\/p>\n<p>SubscriptionId : xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx<\/p>\n<p>Certificate : [Subject]<\/p>\n<p>CN=Windows Azure Tools<\/p>\n<p>[Issuer]<\/p>\n<p>CN=Windows Azure Tools<\/p>\n<p>[Serial Number]<\/p>\n<p>xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx<\/p>\n<p>[Not Before]<\/p>\n<p>5\/5\/2013 10:11:33 AM<\/p>\n<p>[Not After]<\/p>\n<p>5\/5\/2014 10:11:33 AM<\/p>\n<p>[Thumbprint]<\/p>\n<p>Xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx<\/p>\n<p>Now you can run all of your Azure tasks via PowerShell instead of the console. Details of the Azure PowerShell commands we use moving forward will be posted shortly.<a id=\"_GoBack\"><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Start by installing Azure PowerShell on your system. I have it installed on a Windows 2008 r2 server and a Windows 7 laptop, it works fine on either. The install files can be found at the following location. http:\/\/www.windowsazure.com\/en-us\/downloads\/?fb=en-us When &hellip; <a href=\"https:\/\/pipe2text.com\/?page_id=1824\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"open","ping_status":"open","template":"","meta":{"_coblocks_attr":"","_coblocks_dimensions":"","_coblocks_responsive_height":"","_coblocks_accordion_ie_support":"","footnotes":""},"class_list":["post-1824","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/pipe2text.com\/index.php?rest_route=\/wp\/v2\/pages\/1824","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pipe2text.com\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/pipe2text.com\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/pipe2text.com\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/pipe2text.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1824"}],"version-history":[{"count":13,"href":"https:\/\/pipe2text.com\/index.php?rest_route=\/wp\/v2\/pages\/1824\/revisions"}],"predecessor-version":[{"id":1833,"href":"https:\/\/pipe2text.com\/index.php?rest_route=\/wp\/v2\/pages\/1824\/revisions\/1833"}],"wp:attachment":[{"href":"https:\/\/pipe2text.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1824"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}