简体   繁体   中英

How to get price data from Azure API for individual resources?

I am using the API mentioned on https://msdn.microsoft.com/en-us/library/azure/mt219004.aspx to get the information on how much individual Azure resources is charging.

However I am getting a 401 response with error message as

The 'Authorization' header is missing."

There seems to be lack of documentation on how to make the API call with proper authentication.

Thanks for any help in advance.

If you are making the call interactively, you can use the same AuthenticationContext.AcquireToken method the billing reference application is using to authenticate example source.

If you want to call the billing API unattended from a service for instance, I have an example here using a service principal.

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