简体   繁体   中英

How to list azure vm images by API using Python script?

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:

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM