Git Product home page Git Product logo

Comments (4)

gatti2602 avatar gatti2602 commented on June 3, 2024

Hit the same issue today, ResourceGroup got completely ignored and all the machines in the subscription got affected.

As per docs in here, this should work:

In the request body, if you want to manage VMs for specific resource groups, modify the request body as shown in the following example. Each resource path specified must be separated by a comma. You can specify one resource group or more if required.

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"
    ]
  }
}

from startstopv2-deployments.

PrismaComputer avatar PrismaComputer commented on June 3, 2024

Dear gatti2602,

thank you for your answer. Glad (and sad the same time) that you hit the same problem. So it seems to be not on us.
Are holidays in the US, or why is nobody from MS answering this thread?

EDIT: Tried to update, but this

from startstopv2-deployments.

dinvlad avatar dinvlad commented on June 3, 2024

Are holidays in the US

There's Microsoft Build conference this week, which might explain some of this, but judging by lack of recent commits or answers to other issues, I'd hazard a guess that there's no longer a person assigned to it, sadly.

from startstopv2-deployments.

PrismaComputer avatar PrismaComputer commented on June 3, 2024

OK, I found a solution, or better an explanation. The main misunderstanding seems to come from a bad documentation and partially not working examples. Maybe it's also unintended behaviour of the function app. But we will never know, nobody is answering here.

Explanation:
"ResourceGroups" and "Subscriptions" logically expand "RequestScopes", they do not limit the scope. Means:

  • If you name a subscription in "Subscriptions", all VMs in the subscription are targeted. Despite single named VMs or resource groups.
  • If you name a resource group in "ResourceGroups", all VMs in the Resource group are targeted. Despite single named VMs.

Leaving "Subscriptions" blank or out, solved my problem:

{
  "Action": "start",
  "EnableClassic": false,
  "RequestScopes": {
    "ExcludedVMLists": [
      "/subscriptions/11111111-2222-3333-4444-555555555555/resourceGroups/DEFAULT-STORAGE-WESTEUROPE/providers/Microsoft.Compute/virtualMachines/VM01",
      "/subscriptions/11111111-2222-3333-4444-555555555555/resourceGroups/DEFAULT-STORAGE-WESTEUROPE/providers/Microsoft.Compute/virtualMachines/VM08"
    ],
    "ResourceGroups": [
      "/subscriptions/11111111-2222-3333-4444-555555555555/resourceGroups/Default-Storage-WestEurope/"
    ]
  }
}

from startstopv2-deployments.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.