Share via

Invoke resource operation - not working for instanceView

Cosmina Alexandra Jelea (RO) 165 Reputation points
2023-12-13T11:10:54.72+00:00

Hello,

I am trying to get the status of all the VMs from my subscription, using Invoke resource operation (instanceView) within Logic app.

Unfortunately, I get this error "Invalid operation path input value."

The error from logic app run is: "Resource not found", although the resource does exist.

Can you please help me with this issue?

Thank you!

the portion of relevant code is:

            "Invoke_resource_operation": {
                "inputs": {
                    "host": {
                        "connection": {
                            "name": "@parameters('$connections')['arm']['connectionId']"
                        }
                    },
                    "method": "get",
                    "path": "/subscriptions/@{encodeURIComponent('*******')}/resourcegroups/@{encodeURIComponent('rgvm1')}/providers/Microsoft.Compute/virtualMachines/@{encodeURIComponent('vm1')}/@{encodeURIComponent('instanceView')}",
                    "queries": {
                        "x-ms-api-version": "2023-09-01"
                    }
                },
                "runAfter": {},
                "type": "ApiConnection"
            }
Azure Logic Apps
Azure Logic Apps

An Azure service that automates the access and use of data across clouds without writing code.

{count} votes

Answer accepted by question author
  1. VenkateshDodda-MSFT 25,251 Reputation points Microsoft Employee Moderator
    2023-12-13T14:10:08.1466667+00:00

    @Cosmina Alexandra Jelea (RO) for reaching out to Microsoft Q&A, apologize for any inconvenience caused on this.

    Based on the screenshot, it looks like the virtual machine is not found could you please check whether this particular machine is present (in the same resource group that your passing) or not.

    The Api Version you are using is "2023-09-01" as per the virtual machine instance view documentation I can see the latest Api Version is "2023-07-01"

    By default, Invoke Resource Operation is performing POST method instead of GET in order to pull the instance view of the virtual machine you need to use GET method.

    Alternatively, to achieve your requirement I would suggest you to use the HTTP connector and call the respective Azure Management rest API of instance view.

    Feel free to reach back to me if you have any further questions on this.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.