To download Azure PowerShell, open URL azure.microsoft.com à download à PowerShell.
Pre-Requisites for Cross platform and other services are: Visual Studio 2015 & VS 15 Preview Azure.
Three modules get installed part of Azure PowerShell installation
- Azure (Azure service management)
- AzureResourceManager
- AzureProfile
Two modes to connect to Azure via PowerShell
- Azure Service Management
- Azure Resource Manager
- With Certificate method login, you will have only Azure Service Management Mode.
- With Azure Login Method, you will have both Azure Service Management and Azure Resource Manager mode.
- Be default using Azure account login method in PowerShell, you log into Azure Service Management mode. To switch to Azure Resource Manager mode.
Switch-AzureMode -Name AzureResourceManager
Using Certificate Login Method
- Get-AzurePublishSettingsFile - will download the credential file post login, save the file. File contains subscription ID and managed certificates.
- Import the file in Powershell - Import-AzurePublishSettingsFile <Path with file name>
- Get-AzureSubscription
- Get-AzureVM (lists all VMs created under the subscription)
- Get-AzureVM | f1 (to get VM details)
- Remove-AzureSubscription <Subsciption Name> (to remove the subscription from Azure - disconnect in Azure)
Using Azure Account Login Method
- Add- AzureAccount (promt to login with email id and pwd)
- Get- AzureSubscription
- Get- AzureVM
- Remove- AzureAccount -Name <DefaultAccount (email account) >
To Get all Azure PowerShell Commands
Get-Command -Module Azure | Get-Help | Format-Table Name, Synopsis -Wrap | Out-File C:\temp\azurehelp.txt