Virtual Machines

Rising Flight 4,596 Reputation points
2024-07-07T04:42:41.2033333+00:00

Hi all

I am using Azure API Management. I want to fetch all the VMs in one of my subscriptions. I am not sure which API to use and how to use the API. Please guide me

Azure API Management
Azure API Management
An Azure service that provides a hybrid, multi-cloud management platform for APIs.
2,177 questions
Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
8,024 questions
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,310 questions
0 comments No comments
{count} votes

Accepted answer
  1. Adharsh Santhanam 4,370 Reputation points
    2024-07-07T05:08:22.0366667+00:00

    Hello Rising Flight, to list all the VMs inside an Azure subscription, you would want to do something like this.

    Send a GET request to the following API endpoint https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.Compute/virtualMachines?api-version=2024-03-01

    Check out the source link that I've referenced below to understand the various URI parameters and the responses from the above endpoint

    Source: https://learn.microsoft.com/en-us/rest/api/compute/virtual-machines/list-all?view=rest-compute-2024-03-01&tabs=HTTP

    Please do not forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.

    0 comments No comments

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.