Quantcast
Channel: Rob V IT
Viewing all articles
Browse latest Browse all 64

Manage Microsoft Azure with PowerShell

$
0
0

Today I finally activated my free trial subscription on Microsoft Azure. This gives me the possibility to play around with all the nice Azure features. After playing around in the GUI I wanted to start looking at the PowerShell commands to manage my Azure subscription with PowerShell locally.

There is a difference between the old and the new PowerShell module, the old module is the “Azure” module with is based on the old portal and Azure Service Manager (ASM) model. The new module “AzureRM” is based on the Azure Resource Manager (ARM) technology. Don’t like old stuff so I use the new AzureRM commands.

Fist we need to Install the Resource Manager module, start PowerShell as Administrator.

#Install the Azure resource manager module locally
Install-Module AzureRM 

#Import the Azure resource manager module
Import-AzureRM

Then login to your subscription with the command.

Login-AzureRmAccount

Now you are connected to the Azure Resource manager.
Some sample commands:

#Get azure subscription with PowerShell
Get-AzureRMSubscription | ft SubscriptionName, state 

#Create a resourcegroup
New-AzureRmResourceGroup -Name TST001 -Location 'West Europe' 

#Remove resourcegroup without asking
Remove-AzureRmResourceGroup -name TST001 -Force 

#Get Azure resource manager related commands
Get-command *AzureRM*

 


Viewing all articles
Browse latest Browse all 64

Trending Articles