{"id":4217,"date":"2022-06-30T13:37:46","date_gmt":"2022-06-30T20:37:46","guid":{"rendered":"https:\/\/SUMMALAI.COM\/?p=4217"},"modified":"2022-06-30T13:37:47","modified_gmt":"2022-06-30T20:37:47","slug":"how-to-install-azure-powershell-module-and-connect-to-your-tenant","status":"publish","type":"post","link":"https:\/\/SUMMALAI.COM\/?p=4217","title":{"rendered":"How to Install Azure PowerShell Module and Connect to Your Tenant?"},"content":{"rendered":"\n<p>Azure PowerShell is a set of modules that allow you to manage Microsoft Azure from the PoSh command line. These modules used when creating and configuring cloud services, managing virtual machines, networks, web applications, and other Azure resources. In this article, we will show how to install Azure PowerShell on Windows 10.<\/p>\n\n\n\n<p>The easiest way to install Azure PowerShell Modules is to install it from the PowerShell Gallery using PowerShellGet.<\/p>\n\n\n\n<p><strong>Hint<\/strong>. There are currently two modules for managing Azure: Azure Az and AzureRM. AzureRM was released in December of 2018 and is currently deprecated. Therefore, for now, you only need to use the Azure Az module. If you have AzureRM installed on your computer, uninstall it with the command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Uninstall-Module -Name AzureRm -AllVersions<\/pre>\n\n\n\n<p>Prerequisites:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>Windows PowerShell version 5.1 or newer should be installed on your computer. On Windows 10, PowerShell 5.1 is installed by default. You can check the current PowerShell version with the command:<\/strong>&nbsp;<strong>$PSVersionTable.PSVersion&nbsp;<\/strong>On Windows 8.1 and Windows Server 2012 R2, Windows Management Framework 5.0 must be installed to upgrade to PowerShell 5.1;<\/li><\/ul>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/theitbros.com\/wp-content\/uploads\/2021\/05\/word-image-57.png\" alt=\"install azure powershell\" class=\"wp-image-22810\" title=\"install azure powershell\"\/><\/figure><\/div>\n\n\n<ul class=\"wp-block-list\"><li><strong>.NET Framework 4.7.2<\/strong>&nbsp;or newer must be installed on your device. If the following PowerShell script returns True, it means that .Net 4.7.2 or higher is installed:(Get-ItemProperty -Path &#8216;HKLM:\\Software\\Microsoft\\NET Framework Setup\\NDP\\v4\\Full&#8217; -ErrorAction SilentlyContinue).Release -ge 461808<\/li><\/ul>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/theitbros.com\/wp-content\/uploads\/2021\/05\/word-image-58.png\" alt=\"install az module\" class=\"wp-image-22811\" title=\"install az module\"\/><\/figure><\/div>\n\n\n<ul class=\"wp-block-list\"><li><strong>PowerShellGet 1.1.2.0 or higher<\/strong>&nbsp;must be installed on your computer. Check the current version with the command:Get-Module -Name PowerShellGet -ListAvailable | Select-Object -Property Name,Version,Path<\/li><\/ul>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/theitbros.com\/wp-content\/uploads\/2021\/05\/word-image-59.png\" alt=\"azure active directory module for windows powershell\" class=\"wp-image-22812\" title=\"azure active directory module for windows powershell\"\/><\/figure><\/div>\n\n\n<p>In our example, PowerShellGet version 1.0.0.1 is installed. Update it with the command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Install-Module PowerShellGet \u2013Force<\/pre>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/theitbros.com\/wp-content\/uploads\/2021\/05\/word-image-60.png\" alt=\"install azure ad powershell\" class=\"wp-image-22813\" title=\"install azure ad powershell\"\/><\/figure><\/div>\n\n\n<p>You are now ready to install the Azure PowerShell modules. Microsoft recommends installing Azure PowerShell only for an active user of the computer with the command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Install-Module -Name Az -AllowClobber -Scope CurrentUser<\/pre>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/theitbros.com\/wp-content\/uploads\/2021\/05\/word-image-61.png\" alt=\"azure ad powershell module\" class=\"wp-image-22814\" title=\"azure ad powershell module\"\/><\/figure><\/div>\n\n\n<p>You will receive a warning about using an untrusted repository. You need to select Yes or Yes to All:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>Untrusted repository<\/p><p>You are installing the modules from an untrusted repository. If you trust this repository, change its InstallationPolicy value by running the Set-PSRepository cmdlet. Are you sure you want to install the modules from \u2018PSGallery\u2019?<\/p><\/blockquote>\n\n\n\n<p>Then confirm the NuGet installation.<\/p>\n\n\n\n<p>If you want to install Azure Module for all users of the computer, run:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Install-Module -Name Az -AllowClobber -Scope AllUsers<\/pre>\n\n\n\n<p>To check if the Azure Az module is installed on your computer (and to check its version) use the command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Get-InstalledModule -Name Az | select Name, Version<\/pre>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/theitbros.com\/wp-content\/uploads\/2021\/05\/word-image-62.png\" alt=\"install azure powershell module\" class=\"wp-image-22815\" title=\"install azure powershell module\"\/><\/figure><\/div>\n\n\n<p>To update the Azure AD PowerShell Module to the latest version, run the command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Update-Module -Name Az<\/pre>\n\n\n\n<p>To import the installed Az module into the current PowerShell session, run the command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Import-Module -Name Az<\/pre>\n\n\n\n<p>You are now ready to connect to your Azure tenant. Run the command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Connect-AzAccount<\/pre>\n\n\n\n<p>Log in with your credentials (it\u2019s recommended using MFA).<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/theitbros.com\/wp-content\/uploads\/2021\/05\/word-image-63.png\" alt=\"windows azure active directory module for windows powershell\" class=\"wp-image-22816\" title=\"windows azure active directory module for windows powershell\"\/><\/figure><\/div>\n\n\n<p>If your account is associated with multiple Azure tenants, or your status is Cloud Solution Provider (CSP), you can specify the tenant ID to connect:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Connect-AzAccount -Tenant '****-****-****-****\u2019<\/pre>\n\n\n\n<p>You can list the subscriptions available to your account using the command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Get-AzSubscription\n\nRef: https:\/\/theitbros.com\/install-azure-powershell\/<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Azure PowerShell is a set of modules that allow you to manage Microsoft Azure from the PoSh command line. These modules used when creating and configuring cloud services, managing virtual machines, networks, web applications, and other Azure resources. In this article, we will show how to install Azure PowerShell on Windows 10. The easiest way <a class=\"read-more\" href=\"https:\/\/SUMMALAI.COM\/?p=4217\">Read More<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[10,15],"tags":[1222,1221],"class_list":["post-4217","post","type-post","status-publish","format-standard","hentry","category-microsoft","category-windows-servers","tag-install-azure-module-powershell","tag-install-azure-powershell-module"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/posts\/4217","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4217"}],"version-history":[{"count":1,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/posts\/4217\/revisions"}],"predecessor-version":[{"id":4218,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/posts\/4217\/revisions\/4218"}],"wp:attachment":[{"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4217"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4217"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4217"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}