How To Install And Configure PowerShell For Azure
Hello Everyone
Welcome to CloudAffaire and this is Debjeet.
In this blog post, we will discuss how to install and configure PowerShell for Azure cloud.
What Is PowerShell?
PowerShell is a cross-platform task automation and configuration management framework, consisting of a command-line shell and scripting language.
What is Azure?
Microsoft Azure is one of the leading cloud service providers in the market with 18% market share.
Prerequisites:
- One Windows system with PowerShell 5.0 or higher.
- One active Azure account with full access.
If you have a lower version of PowerShell, please install the latest version of PowerShell (minimum version 5 is required) using below link. You can check your PowerShell version using the $PSVersionTable command.
https://github.com/PowerShell/PowerShell/releases
How To Install And Configure PowerShell For Azure:
Step 1: Open PowerShell terminal as administrator and execute the below command to install the PowerShell module for Azure.
1 |
Install-Module -Name Az -AllowClobber -Scope AllUsers -Force |
Step 2: Once the PowerShell module is installed for Azure; you can list all the cmdlets using the below command.
1 2 3 4 5 6 7 8 |
## List all PowerShell cmdlet, functions, and alias for Azure Get-Command -Module Az.* ## List all PowerShell cmdlet, functions, and alias for a particular service Get-Command -Module Az.Compute ## List all PowerShell cmdlets, functions, and alias for a particular resource type and command type. Get-Command -Verb Get -Noun AzVM* -Module Az.Compute |
Step 3: Get help on an Azure PowerShell cmdlet.
1 |
Get-Help Get-AzVM -full |
Step 4: Configure your Azure PowerShell authentication. Provide your Azure username and password when asked.
1 |
Connect-AzAccount |
Step 5: Check if Azure credential working using the below command.
1 |
Get-AzSubscription |
Step 5: Execute your 1st PowerShell command for Azure.
1 |
Get-AzLocation |
Hope you have enjoyed this blog post. To get more details on PowerShell for Azure, please refer to below links.
https://docs.microsoft.com/en-us/powershell/azure/
https://docs.microsoft.com/en-us/powershell/azure/install-az-ps
https://docs.microsoft.com/en-us/powershell/module/?view=azps-4.8.0