Whether it is possible to list above questions by api using Python script
I am not getting exactly what I need
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: