简体   繁体   中英

Get classic portal disks Azure REST

https://management.azure.com/subscriptions/subID/providers/Microsoft.Compute/disks?api-version=2017-03-30

this gives me all Disks of New Azure portal.

replacing the above Microsoft.Compute to Microsoft.ClassicCompute does not give me the classic portal disks as there is no resource type called disks under classiccompute namespace.

what is the alternate to get classic portal disks?

Have tried https://management.core.windows.net/subid/services/disks but this uses a different auth mechanism all together is there any other endpoint?

As you want to get the classic disks so we can Azure service management REST API that you mentioned.

https://management.core.windows.net/subscription-id/services/disks

How to authenticate Service Management Requests please refer to the official document .

Use X509 Certificate - You can always use X509 Certificate based authorization to authorize your SM API requests

X509Certificate2 certificate = GetStoreCertificate(Thumbprint);
HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(uri);
request.ClientCertificates.Add(certificate);

How to create a new self-signed certificate please refer to document

We also need to upload the certificate under subscription.

在此处输入图片说明

The following is my test result via postman. 在此处输入图片说明

Other related links:

manage.windowsazure.com vs. portal.azure.com

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