Managing Azure dev environment from PowerShell

Recently, I’ve been spending some time prototyping the new SharePoint 2013 App Model in my Azure provision SP2013 development environment.  I wanted to make sure that i can shut it down or start it up quickly.  So PowerShell is of course the answer here.

Small assumption is that the Azure Service Name matches the Virtual Machines. It is possible to have multiple virtual machines provisioned under the same service Name

First, ensure that the valid Azure subscription is attached to the Azure command line session:

Get-AzureAccount

If that returns no subscriptions, then use Add-AzureAccount commandlet to add an active subscription.
To start/stop the Azure Virtual Machines I use these commands:

Get-AzureVM -ServiceName <ServiceName> | Start-AzureVM
Get-AzureVM -ServiceName <ServiceName> | Stop-AzureVM -Force:$true

I’ll add more commands as i start doing more complex things with Azure dev boxes as I go along.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s