How to automate shutdown and auto start for VMs in Azure ?

Remon Girgis 40 Reputation points
2023-11-25T21:06:56.46+00:00

I have a number of VMs that need to be shutdown at 5:00 PM and started automatically at 8:00 AM.

These virtual machines perform a certain tasks during the day but not required after hours.

Thanks

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
9,013 questions
{count} votes

Accepted answer
  1. Adam Zachary 2,936 Reputation points
    2023-11-25T21:16:51.7366667+00:00

    Hi Ramon,

    To automate the shutdown and auto-start of VMs in Azure at specific times (e.g., shutdown at 5:00 PM and start at 8:00 AM), you can use Azure Automation's Start/Stop VMs during off-hours feature. Here are the steps to achieve this:

    1. Access Azure Automation:
      • Go to the Azure portal and open Azure Automation.
    2. Create Automation Account:
      • If you don't already have one, create a new Azure Automation account.
    3. Deploy Start/Stop VMs Solution:
      • Deploy the "Start/Stop VMs during off-hours" solution. This can be found under the Automation Account.
    4. Configure Schedules:
      • Configure the schedules for starting and stopping the VMs. Specify the times (e.g., stop at 5:00 PM, start at 8:00 AM).
    5. Assign VMs to the Schedules:
      • Assign the VMs to these schedules. You can target specific VMs or resource groups.
    6. Configure Runbooks:
      • The solution includes preconfigured runbooks. You may customize them if needed for more specific control over the VMs.

    Hope this helps!

    Kindly if you find the provided information helpful and it resolves your query, please consider accepting the answer. Your feedback is valuable and helps ensure the quality and relevance of the responses.

    4 people found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Zeyad Alezzi 15 Reputation points
    2024-10-07T15:50:18.73+00:00

    login to your azure >> go to your vm >> Automation >> Tasks (Previwe)>> add you shutdown and Startup

    schedules .

    Note :-

    Certainly! If you're using a dynamic IP address for your Azure Virtual Machine (VM) and the IP address changes (for example, due to unavailability in your region), any other applications or services that connect to your VM will need to be updated with the new IP address.

    2 people found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.