What is your Virtual Function?

Machine shut down

With the release of the RunAs feature in Azure Automation. A service account can now be called in Azure Automation scripts to enable and run Resource Manager functions.

I think one of the most useful features of this is to auto shutdown virtual machines by TAG.

In the example below I have set up the following:

A TAG called “Environment” with and ID of “Lab” and applied to each VM I want to control.

A RunAs service account as part of my AzureAutomation resource.

A PowerShell Workflow script to scan for the TAGs applied to Windows virtual machines and to shut them all down in parallel.

An Azure Automation schedule to run Monday-Friday at 17:00 to call the published workflow.

When configuring a schedule through the browser it uses the browser’s local time zone. This is stored in UTC but is converted for you. You’ll need to consider this is managing multiple resources across the globe.

Last Tweets

I was lucky enough to join the Australian Institute of Company Directors swim team for the #PorttoPub swim in Perth Western Australia. The race was called off at the three hour mark due to the tough conditions. However it proved again to me that a good t…https://t.co/AMf3zGNVEx,7 hours ago