Start/Stop VMs v2 error 404 not found

2024-05-13T08:14:34.6566667+00:00

Hello,

starting last friday, with no changes on the configuration, my Start/Stop VMs v2 script goes on error 404 resource not found when trying to start the virtual machine.

The subscription ID is correct, and there is only one VM in the subscription.

I'm in the Function-Try step, with the following code:

{
  "Action": "start",
  "EnableClassic": false,
  "RequestScopes": {
    "ExcludedVMLists": [],
    "Subscriptions": [
      "/subscriptions/MYSUBSCRIPTIONID/"     
]
  }
}

(where MYSUBSCRIPTIONID is my number c61...-....-....-....-.......)

The output says


{
    "statusCode": 404,
    "headers": {
        "Date": "Fri, 10 May 2024 05:15:14 GMT",
        "Request-Context": "appId=cid-v1:285f25a8-8630-40d1-a38d-aab9e9978435",
        "X-Content-Type-Options": "nosniff",
        "Content-Length": "0"
    }
}

Any suggestion on how to fix it?

Thank you,

Fabio

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,286 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Gowtham CP 1,655 Reputation points
    2024-05-13T09:05:31.1866667+00:00

    Hello @Fabio Nogarotto - Brianza Sistemi snc

    Thanks for reaching out in the Microsoft Q&A!

    The "404 Resource Not Found" error in your Start/Stop VMs v2 script indicates the script cannot locate the virtual machine you're trying to start. To troubleshoot, first, double-check your subscription ID and ensure it matches accurately. Verify the VM name targeted in your script and check its existence in the Azure portal. Temporary resource availability issues on Azure's end might also be a factor, so consider retrying the script later. Review the configuration of the Function-Try step in your Azure Function. You can find relevant documentation here: Start/Stop VMs v2 Overview and Azure Functions Documentation. With these steps and insights, you should be able to resolve the error and get your script working smoothly again.

    If you found this solution helpful, consider accepting it.