Logic app designer - Task automation

AB123 356 Reputation points
2023-06-08T14:43:22.49+00:00

Hi all,

 

I need to configure the logic app which is premade to start and also power down VM. 

 

I would like my VM to Start up in mornings during weekdays and not at all on weekends

 

I would like my VM to Stop in evenings during week days and stop all day on Weekends

 

Is this possible ?

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
9,013 questions
Azure Automation
Azure Automation
An Azure service that is used to automate, configure, and install updates across hybrid environments.
1,366 questions
{count} votes

Accepted answer
  1. Boris Von Dahle 3,221 Reputation points
    2023-06-08T18:22:22.0666667+00:00

    Hello,

    To handle starting and stopping VM using Azure Logic Apps you could use Azure Automation Runbooks

    but the documentation on Start/Stop VM says :

    User's image

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

    To start and stop VMs with Logic Apps and Azure Functions you can follow this documentation :
    https://learn.microsoft.com/en-us/azure/azure-functions/start-stop-vms/overview

    and deploy from this repo : https://github.com/microsoft/startstopv2-deployments/blob/main/README.md

    Start/Stop VMs shared status dashboard

    If you have only a few VM to manage , you could write your own powershell runbooks like this :

    $vms = Get-AzureVM
    foreach($vm in $vms)
    {
        Start-AzureRmVM -ResourceGroupName "YourResourceGroupName" -Name "$vm"
    }
    

    If this answer was helpful, please mark it as accepted so other users with same questions can find this topic.

    Regards


0 additional answers

Sort by: Most helpful

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.