How does the Auto-Shutdown feature for VMs work?

Syed Harith Zaki 120 Reputation points
2024-12-18T03:07:47.2+00:00

Hi,

I was wondering how to schedule for the VMs to automatically shut down at a specified timing and start up at a specified timing? The plan is to have the VMs powered off during off-hours to optimise costs. The Auto-Shutdown feature only provides the option to schedule the shutdown not the startup. Do I have to manually start up the VM if I use this feature?

Please advise if this feature is able to meet my requirements or if I have to consider other automation solutions available on Azure.

Thanks,

Zaki

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
8,222 questions
0 comments No comments
{count} votes

Accepted answer
  1. Mounika Reddy Anumandla 1,550 Reputation points Microsoft Vendor
    2024-12-18T05:36:58.8933333+00:00

    Hi Syed Harith Zaki,

    Welcome to the Microsoft Q&A Platform! Thank you for asking your question here.

    The Auto-Shutdown feature in Azure allows you to schedule VMs to shut down at a specified time, but it does not provide a built-in option for scheduling startup. Therefore, if you use this feature alone, you will have to manually start the VMs after they have been shut down. To automate both shutdown and startup, there are several ways. You can use Azure Automation with Runbooks, Azure Functions or Azure Logic Apps. These options allow you to write scripts that can initiate the shutdown or startup of VMs at scheduled times.

    This video will show you how to set this up using automation task: https://learn.microsoft.com/en-gb/shows/IT-Ops-Talk/Auto-Shutdown-and-Auto-Start-an-Azure-VM

    The easiest approach is the Logic App that you can deploy as part of the Virtual Machine automation features.

    Take a look at this: https://learn.microsoft.com/en-us/azure/logic-apps/create-automation-tasks-azure-resources

    To automate the schedule of your virtual machines, you can also follow: https://learn.microsoft.com/en-us/azure/azure-functions/start-stop-vms/overview#enable-and-configure.
    https://learn.microsoft.com/en-us/azure/azure-functions/functions-create-scheduled-function

    Let me know if you have any further queries.

    If the comment is helpful, please click "upvote".

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Abiola Akinbade 21,460 Reputation points
    2024-12-18T11:53:50.9566667+00:00

    An alternative way I know of to implement this is by using an automation account.

    In the Azure Portal, navigate to Create a resource > Automation > Automation Account. A previously described answer for this can be found here.

    See: https://learn.microsoft.com/en-us/answers/questions/1439565/how-to-automate-shutdown-and-auto-start-for-vms-in

    I also found a youtube video here that describes in detail how to set it up: https://www.youtube.com/watch?v=EFXcRt7auuU

    You can mark it 'Accept Answer' and 'Upvote' if this helped you

    Regards,

    Abiola

    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.