Microsoft Azure – Scheduled VM Shutdown with Azure Automation


Introduction

Step 1: Create a new user in Active Directory

Step 2: Specify a co-administrator for subscriptions

Step 3: Add a New Automation Account

Step 4: Create Credential Automation Asset

Step 5: Create a Runbook

Step 6: Add a Schedule for Runbook

Step 7: Test and Publish the Runbook

Step 8: Link the Runbook to an Existing Schedule

Conclusion

 

Introduction

Running of Virtual Machines depends on computing hours or in another words it depends on how many hours Virtual Machines are running per day.  For example, if you are using Virtual Machines for West US region, with configuration that includes SSD drive, 2 cores, 7 GB RAM and 100 GB disk, it will cost you $208.32 per month. Microsoft Azure site also provides pricing calculator, which will show you the exact price and configuration of Azure features for your scenarios. Please visit https://azure.microsoft.com/en-us/pricing/calculator/ for more details. Using Virtual Machines with high configuration can be very expensive, but you can reduce the cost of Virtual Machines by reducing its working hours with Automated Shutdown.  This post will describe how to create an Automated Shutdown of Virtual Machines on Windows Azure. You will see the step-by-step instructions and a detailed walkthrough of the process of creating Runbook and Schedule for Virtual Machines and how to link the Runbook to Schedule so that it get automatically stop at pre-defined times.

Step 1: Create a new user in Active Directory

PowerShell script is Microsoft’s task-based command-line shell and scripting language designed especially for system administration. In order to run the PowerShell Script with Microsoft Azure, you will need to have a User linked to one of your Directories. If you don’t have it, you will need to create one.

  1. Open the Microsoft Azure Portal and click on ACTIVE DIRECTORY from the navigation pane. Azure Active Directory is a comprehensive identity and access management cloud solution that provides a robust set of capabilities to manage users and groups.
  2. From the list of active directories, we will click on our directory. In our case it is Default Directory.
  3. Under default directory, click on USERS.
  4. From the command bar at the bottom of the Portal screen, click on ADD USER.

1-1 Create a new user to run the PowerShell Script with Microsoft Azure

5. A new window Tell us about this user will appear…….

Continue reading here…

Share This: