{"id":2542,"date":"2018-07-30T23:25:21","date_gmt":"2018-07-30T23:25:21","guid":{"rendered":"http:\/\/microsoftgeek.com\/?p=2542"},"modified":"2020-10-22T00:27:40","modified_gmt":"2020-10-22T05:27:40","slug":"how-to-connect-to-microsoft-azure-using-powershell","status":"publish","type":"post","link":"https:\/\/microsoftgeek.com\/?p=2542","title":{"rendered":"How to connect to Microsoft Azure using Powershell"},"content":{"rendered":"<p>Install the following components on your system to connect to your Microsoft Azure subscription using PowerShell:<\/p>\n<p><a href=\"http:\/\/www.microsoft.com\/en-us\/download\/details.aspx?id=41950\" target=\"_blank\" rel=\"noopener noreferrer\"><strong>Microsoft Online Service Sign-in Assistant for IT Professionals RTW<\/strong><\/a><br \/>\nSelect the appropriate version of your OS<\/p>\n<p><a href=\"http:\/\/go.microsoft.com\/fwlink\/p\/?linkid=236297\" target=\"_blank\" rel=\"noopener noreferrer\"><strong>Azure Active Directory Module for Windows PowerShell<\/strong><\/a>\u00a0(64-bit version)<br \/>\nThe 32-bit version is discontinued by October 20, 2014.<\/p>\n<p>You must be a tenant administrator (i.e. company administrator, global administrator) to successfully establish a connection to your Azure subscription using PowerShell.\u00a0<a href=\"https:\/\/azure.microsoft.com\/en-us\/documentation\/articles\/active-directory-assign-admin-roles\/\" target=\"_blank\" rel=\"noopener noreferrer\">Read here how to assign admin roles in Azure AD.<\/a><\/p>\n<p>You\u2019re now ready to connect to your Azure subscription using PowerShell!<\/p>\n<ul>\n<li>To do so, run the\u00a0<strong>Microsoft Azure PowerShell<\/strong>\u00a0console as administrator<\/li>\n<li>Enter the following PowerShell command:\n<div id=\"crayon-5b5f9d9844583979418534\" class=\"crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate\" data-settings=\" minimize scroll-mouseover\">\n<div class=\"crayon-plain-wrap\"><\/div>\n<div class=\"crayon-main\">\n<table class=\"crayon-table\">\n<tbody>\n<tr class=\"crayon-row\">\n<td class=\"crayon-nums \" data-settings=\"show\">\n<div class=\"crayon-nums-content\">\n<div class=\"crayon-num\" data-line=\"crayon-5b5f9d9844583979418534-1\"><span style=\"color: #ff00ff;\">1<\/span><\/div>\n<\/div>\n<\/td>\n<td class=\"crayon-code\">\n<div class=\"crayon-pre\">\n<div id=\"crayon-5b5f9d9844583979418534-1\" class=\"crayon-line\"><span style=\"color: #ff00ff;\"><span class=\"crayon-v\">Add<\/span><span class=\"crayon-o\">&#8211;<\/span><span class=\"crayon-v\">AzureAccount<\/span><\/span><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/li>\n<li>You are prompted to enter your Azure credentials:<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-3525 size-full\" src=\"http:\/\/www.techtask.com\/wp-content\/uploads\/2015\/07\/2015-07-02_233031.png\" alt=\"\" width=\"240\" height=\"239\" \/><\/li>\n<li>If you have a work or school account, you can bypass the pop up windows using this command:\n<div id=\"crayon-5b5f9d984458c740102314\" class=\"crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate\" data-settings=\" minimize scroll-mouseover\">\n<div class=\"crayon-plain-wrap\"><\/div>\n<div class=\"crayon-main\">\n<table class=\"crayon-table\">\n<tbody>\n<tr class=\"crayon-row\">\n<td class=\"crayon-nums \" data-settings=\"show\">\n<div class=\"crayon-nums-content\">\n<div class=\"crayon-num\" data-line=\"crayon-5b5f9d984458c740102314-1\"><span style=\"color: #ff00ff;\">1<\/span><\/div>\n<div class=\"crayon-num crayon-striped-num\" data-line=\"crayon-5b5f9d984458c740102314-2\"><span style=\"color: #ff00ff;\">2<\/span><\/div>\n<\/div>\n<\/td>\n<td class=\"crayon-code\">\n<div class=\"crayon-pre\">\n<div id=\"crayon-5b5f9d984458c740102314-1\" class=\"crayon-line\"><span style=\"color: #ff00ff;\"><span class=\"crayon-sy\">$<\/span><span class=\"crayon-v\">cred<\/span> <span class=\"crayon-o\">=<\/span> <span class=\"crayon-v\">Get<\/span><span class=\"crayon-o\">&#8211;<\/span><span class=\"crayon-e\">Credential<\/span><\/span><\/div>\n<div id=\"crayon-5b5f9d984458c740102314-2\" class=\"crayon-line crayon-striped-line\"><span style=\"color: #ff00ff;\"><span class=\"crayon-v\">Add<\/span><span class=\"crayon-o\">&#8211;<\/span><span class=\"crayon-v\">AzureAccount<\/span> <span class=\"crayon-o\">&#8211;<\/span><span class=\"crayon-i\">Credential<\/span> <span class=\"crayon-sy\">$<\/span><span class=\"crayon-v\">cred<\/span><\/span><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/li>\n<li>When connecting the first time to your Azure subscription using PowerShell you need to download, save and import your Publishing Settinge Profile.\n<div id=\"crayon-5b5f9d984458e390958648\" class=\"crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate\" data-settings=\" minimize scroll-mouseover\">\n<div class=\"crayon-plain-wrap\"><\/div>\n<div class=\"crayon-main\">\n<table class=\"crayon-table\">\n<tbody>\n<tr class=\"crayon-row\">\n<td class=\"crayon-nums \" data-settings=\"show\">\n<div class=\"crayon-nums-content\">\n<div class=\"crayon-num\" data-line=\"crayon-5b5f9d984458e390958648-1\"><span style=\"color: #ff00ff;\">1<\/span><\/div>\n<\/div>\n<\/td>\n<td class=\"crayon-code\">\n<div class=\"crayon-pre\">\n<div id=\"crayon-5b5f9d984458e390958648-1\" class=\"crayon-line\"><span style=\"color: #ff00ff;\"><span class=\"crayon-v\">Get<\/span><span class=\"crayon-o\">&#8211;<\/span><span class=\"crayon-v\">AzurePublishSettingsFile<\/span><\/span><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/li>\n<li>Sign in to your Azure Management Portal<\/li>\n<li>When prompted, download and save the publishing profile (depending on your client settings the download may start automatically)<\/li>\n<li>Import the previously downloaded publishing profile\n<div id=\"crayon-5b5f9d9844590830457803\" class=\"crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate\" data-settings=\" minimize scroll-mouseover\">\n<div class=\"crayon-plain-wrap\"><\/div>\n<div class=\"crayon-main\">\n<table class=\"crayon-table\">\n<tbody>\n<tr class=\"crayon-row\">\n<td class=\"crayon-nums \" data-settings=\"show\">\n<div class=\"crayon-nums-content\">\n<div class=\"crayon-num\" data-line=\"crayon-5b5f9d9844590830457803-1\"><span style=\"color: #ff00ff;\">1<\/span><\/div>\n<\/div>\n<\/td>\n<td class=\"crayon-code\">\n<div class=\"crayon-pre\">\n<div id=\"crayon-5b5f9d9844590830457803-1\" class=\"crayon-line\"><span style=\"color: #ff00ff;\"><span class=\"crayon-v\">Import<\/span><span class=\"crayon-o\">&#8211;<\/span><span class=\"crayon-i\">AzurePublishSettingsFile<\/span> <span class=\"crayon-s\">&#8220;C:\\Path\\To\\Your\\AzurePublishingSettings-credentials.publishsettings&#8221;<\/span><\/span><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/li>\n<\/ul>\n<p>You\u2019re all set. Start managing\u00a0your Microsoft Azure subscription\u00a0using this great\u00a0<a href=\"http:\/\/technet.microsoft.com\/library\/jj151815.aspx\" target=\"_blank\" rel=\"noopener noreferrer\">overview of the Azure AD cmdlets<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Install the following components on your system to connect to your Microsoft Azure subscription using PowerShell: Microsoft Online Service Sign-in Assistant for IT Professionals RTW Select the appropriate version of your OS Azure Active Directory Module for Windows PowerShell\u00a0(64-bit version) The 32-bit version is discontinued by October 20, 2014. You must be a tenant administrator [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[69,59],"tags":[],"class_list":["post-2542","post","type-post","status-publish","format-standard","hentry","category-azure","category-powershell"],"_links":{"self":[{"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts\/2542","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2542"}],"version-history":[{"count":3,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts\/2542\/revisions"}],"predecessor-version":[{"id":3060,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts\/2542\/revisions\/3060"}],"wp:attachment":[{"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2542"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2542"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2542"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}