-2

Whether it is possible to list above questions by api using Python script

I am not getting exactly what I need

Sandhya
  • 1
  • 1

1 Answers1

0

See the API here:
https://learn.microsoft.com/en-us/rest/api/compute/virtual-machines/list-all?tabs=HTTP GET https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.Compute/virtualMachines?api-version=2022-11-01

Use PostMan or similar application to do this.

You need a header Authorization Bearer access-token.
headers = {'Authorization': 'Bearer ' + token['accessToken'], 'Content-Type': 'application/json'}

Also see:

Niclas
  • 1,069
  • 4
  • 18
  • 33