How to exclude a VM from a StartStopV2 logic app

Cameron Blackwell 0 Reputation points
2024-05-07T14:38:38.8133333+00:00

Good day,

I have 5 Azure VMs running. I also have a StartStopV2 Logic app that automatically switches these 5 VMs on at a specified date and time. I wish to exclude 1 VM from this logic app, but I don't see a solution for this.

Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
2,996 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. SwathiDhanwada-MSFT 18,556 Reputation points
    2024-05-08T04:41:19.73+00:00

    @Cameron Blackwell Thanks for reaching out. You can exclude the vms by modifying Function-Try action. In the designer pane, select Function-Try to configure the target settings.This example also demonstrates excluding a virtual machine. You can exclude the VM by specifying the VMs resource path or by wildcard.

    {
      "Action": "start",
      "EnableClassic": false,
      "RequestScopes": {
        "Subscriptions": [
          "/subscriptions/12345678-1234-5678-1234-123456781234/",
          "/subscriptions/11111111-0000-1111-2222-444444444444/"
         ],
        "ResourceGroups": [
          "/subscriptions/12345678-1234-5678-1234-123456781234/resourceGroups/rg1/",
          "/subscriptions/11111111-0000-1111-2222-444444444444/resourceGroups/rg2/"
        ],
        "ExcludedVMLists": [
         "/subscriptions/12345678-1234-5678-1234-123456781234/resourceGroups/vmrg1/providers/Microsoft.Compute/virtualMachines/vm1"
        ]
      }
    }