Azure automation can be an Azure administrator's best friend and can ease up your day to day administration work. There are three options available in Azure automation- Graphical runbooks, PowerShell Work flow and Powershell based runbooks
If you want to play around with Azure automation and want to quickly automate some daily mundane tasks, graphical runbooks are the easiest to start with . You can find many templates in the runbooks gallery in Azure that can easily get the job done easily for you. Lets start with the basics. One of the common tasks that needs to be done is to start or stop VM at a scheduled time, say for eg: your Dev/Test machines that should be shutdown after office hours. The runbooks for this are readily available in the gallery. In this blogpost we will focus on a graphical runbook available in the gallery that can be used to start or stop VMs at a scheduled time.
Schedule automated start and stop of VMS using graphical runbook
Create new Azure automation
account from portal using the default settings. Go to
New->management->Automation->new automation account

Browse Automation accounts
and select the newly created account. Click on runbooks tile->Browse gallery
Search for the graphical runbook āStart Azure V2 VMā. For stopping you can use
the graphical template āStop Azure V2 VMā


Import the template
Click on edit and then ātest paneā to do a test run of the template

If you want to start a single VM, give the name of the VM as input parameter. Click on start to do a test run


Publish the runbook to make it available in your automation account

Now you can add a schedule to the runbook

Configure the time when you want the schedule to run

You can select the time and time zone here when you want the schedule to run

Configure input parameters for the schedule, for eg: the VM name or resource group name.
If you want to restart a single VM in a given resource group, specify the name of the resource group as well as the VM name. If you want to start all VMs in a resource group, give the name of the resource group alone

Comments
Post a Comment