Note: these instructions were tested on Windows Server 2019.
Install the Azure Az PowerShell module with PowerShellGet | Microsoft Docs
Check to see the current version of AZ module to determine if it is installed.
Open PowerShell in Administrator mode.
If the below command returns an error, follow the steps below. This infers that the module is not installed.
Get-InstalledModule -Name Az
Make sure your client has .NET 4.7.2 installed by running this command from PowerShell. If it comes back true it is installed.
(Get-ItemProperty -Path ‘HKLM:\Software\Microsoft\NET Framework Setup\NDP\v4\Full’ -ErrorAction SilentlyContinue).Release -ge 461808
If .NET 4.7.2 is not installed here is the link: https://dotnet.microsoft.com/download/dotnet-framework/net472
PowerShell script execution policy must be set to remote signed or less restrictive.
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
To Install just for the the module for the current user use this command:
Install-Module -Name Az -Scope CurrentUser -Repository PSGallery -Force
To Install the module for all users use this command:
Install-Module -Name Az -AllowClobber
After this is finished this command can be used to test connectivity to sign into Azure.
Connect-AzAccount