An Azure service that automates the access and use of data across clouds without writing code.
Thank you for reaching out to Microsoft Q&A.
You have got a couple of options to automate VM restarts in Logic Apps. You can deploy Microsoft’s “Start/Stop VMs v2” solution (it includes scheduled start/stop workflows you can tweak to “Restart”), or build a tiny custom Logic App yourself. Here are the steps below:
Create a new Logic App
In the Azure portal, go to “Create a resource” → “Logic App (Consumption)” → give it a name, resource group, region → Create.
Add a Recurrence trigger
In Logic Apps Designer click “+ New step” → search for “Recurrence” → choose your schedule (every day, every hour, whatever).
Call the “Restart Virtual Machine” action
Click “+ New step” → search for “Azure” → select “Restart virtual machine” (from the Azure Resource Manager connector).
Sign in / create a service-principal–based connection if prompted.
Fill in:
• Subscription – your subscription
• Resource group name – the RG containing the VM
• Virtual machine name – the VM you want to restart
Save and test
Save the Logic App, click “Run” and check the run history to confirm your VM restarted.
(Optional) Loop through multiple VMs
If you need to restart a batch, add an “Initialize variable” → array of VM names, then “For each” over that array and inside the loop call the same “Restart virtual machine” action, this time using the loop variable for the VM name.
If you’d rather start from Microsoft’s drop-in solution:
• Deploy the “Start/Stop VMs v2” ARM template – it creates prebuilt Logic Apps for scheduled start, stop, auto-stop on CPU, and sequenced operations.
• Once deployed, find the logic app named ststv2_vms_Scheduled_start (or ..._stop), open its designer, swap out the stop/start action for “Restart virtual machine,” adjust your recurrence, then Enable.
Hope that gives you a quick path to auto-restarts in Logic Apps!
Reference docs
Azure actions for Logic Apps (start/stop/restart VMs)
Deploy Start/Stop VMs v2 to your subscription
Start/Stop VMs v2 overview (scheduling, sequencing, auto-stop)
Schedule recurring tasks in Logic Apps (Recurrence trigger)
https://docs.microsoft.com/azure/logic-apps/connectors-native-recurrence#add-the-recurrence-trigger