How To Start VM Automatically In Azure

Virtual Machines provide flexibility to install and configure anything, anytime; and use it as you want. Besides all these features, VMs are costly so developers or managers of VMs need to make it cost effective. For this, Azure provides Automation Scripting to start and stop a VM automatically so that it will be cost effective apart from being flexible.

Let’s take a look at Azure Automation Scripting how you can start and stop your VM automatically in Azure. Let’s get started.

  • Login to Azure portal and at the bottom, go to "More Services". 

    Azure

And, search for "Automation Account".

Here, you will have to provide -

  • Account Name
  • Select subscription
  • Select or create resource group
  • Select location
  • If it’s your first automation account, select "Yes" at "Create Azure Run as Account".

    Azure

After Automation Account is created, go to Runbooks in process automation.

Azure

Now, browse the gallery and look for "Start Azure V2 VMs" and "Stop Azure V2 VMs".

Azure

I’ve selected "Start Azure V2 VMs". Now, import it.


Azure

Azure
Give it a name you want. I used the default name. Don’t forget to press OK.

After it is created, it will lead you to Runbooks and now in order to use it, you need to publish it so that you can use it now go to "Edit".

Azure

Now, press "Publish".

Azure

After the Runbook is published, it is ready to schedule. Besides edit, press "Schedule".

Azure

In "Schedule" section, just schedule your VM’s start time and click "Create".

Azure

Now, click on "Start" and give ResourceGroup name and VM’s name in parameters.

Azure

Now, the Runbook is ready. It will start the VM automatically at your given time.


Similar Articles