skip to Main Content

For context, we have an Azure Virtual Machine that we use to test our app before pushing the changes to production. This VM automatically shutdown every evening to save some energy. Is there a way to make it start when trying to access its DNS name (******.cloudapp.azure.com)? It would be better than starting it at a fixed time every morning but if it is impossible or too complicated, is there a way to make it start at a specified time?

2

Answers


  1. Starting the vm using events requires some changes in your architecture.

    You can start a vm at fixed time using automation accounts. Look at this tutorial on Microsoft learn to accomplish your goal

    https://learn.microsoft.com/en-us/azure/automation/automation-solution-vm-management-config

    Login or Signup to reply.
  2. If you had a firewall in front off your VM you could log the HTTP 404 events, then trigger a function that started your VM.

    But it is not trivial and the firewall would add extra cost (it may be more expensive than your VM)

    So the best way is probably just to start the VM at a fixed time.

    If you need the VM permanently you could look into Reserved instances to save costs. It could save you upto 80% https://azure.microsoft.com/en-us/pricing/reserved-vm-instances/

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search