Schedule Start Stop AzureVM Without Log Analytics

I was assigned a task to auto shut off the AzureVMs during weekend and start again on Monday.

During my research, I have found numerous articles as I do not want to reinvent the wheel if some one has already written a script or solution for it.

Numerous articles were pointing to Enable Start/Stop VMs during off-hours

But there are few which I got interested in and now sharing a process here as We do not have log analytics enabled.

First as you might have already guessed we will need Azure Automation account. (create one if you do not have)

Go to https://portal.azure.com –> Search for Automation and hit Automation Accounts.


Click ADD, select the subscription and Create Azure Run As Account


Ones automation account is created, go to automation account à Runbooks


Browse gallery and search from Start VM and Stop VM (it will be from Azure Product group)

Click on import to import it to your runbooks. (Name it as per your Naming convention)


Now you can see both the Graphical RunBooks are imported into your Azure Automation Account.


You have to click edit to modify the parameters and to Publish it.

Click on Input and Output, Select the parameter à toggle Default value to custom and add the resource group name where VMs resides.


Hit ok, Save and Publish.

Now click link to Schedule and define the schedule to start VM.

Follow the same steps for STOP VM activity and Schedule the VM to Stop.


You can use this method to stop Azure VMs during offhours or weekends and then start again when required using Start VM schedule.


 

Thanks for reading…

Tech Wizard

https://techwizard.cloud

https://syscloudpro.com/

PowerShell Cheat Book

 

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 )

Connecting to %s