In this blog post, I ill show you how to manage Microsoft Azure with Azure PowerShell.
Microsoft Azure uses two main programming tools to manage Azure, and they are:
This tool is made of modules that cmdlets based on PowerShell Core and capable of managing every Azure service.
In late 2018 the tools became available to the public and replaced the AZureRM PowerShell module.
This tool is Azure’s cross-platform tool for managing Azure where PowerShell is not compatible with some operating systems.
Install PowerShell 7
Before installing the module, I am going to install the latest PowerShell 7 preview build.
If you have PowerShell 7 you don’t have to install the preview; I just like to run the latest version.
To install AZ PowerShell, I will run the following cmdlet from my PowerShell 7 console.
Install-module -name az -allowClobber
Since all the AZ modules need to get install, it can take 2-3 minutes for the install to complete.
Connect to Azure
To connect to Microsoft Azure using PowerShell I will run the following cmdlet.
Note: The authentication method for Azure will require us to open the URL that shows on the screen and enter the code.
After entering the authentication code, I’m good to go.
To view all the VMs om, my tenant, I will run the following cmdlet.