我最近试图查询Azure最近的使用情况和计费API,发现我可以使用以下API来获取价目表:
https://management.azure.com/subscriptions/{subscription-id}/providers/Microsoft.Commerce/RateCard?api-version=2015-06-01-preview&$filter=OfferDurableId eq '{offer-id}' and Currency eq 'USD' and Locale eq 'en-US' and RegionInfo eq 'US'
但是,这要求我需要明确知道 OfferDurableId,这是我从 Azure's website 中为我的案例了解到的。 .
是否有 API 可以为我提供这些优惠代码?
最佳答案
据我所知,没有 API 可以获取优惠代码。事实上,如果您查看 Billing API 文档 here
,他们还要求您从您提到的链接获取相关信息。
Set {OfferDurableId} to a valid Offer ID code (e.g., MS-AZR-0026P). See Microsoft Azure Offer Details for more information on the list of available Offer IDs, country/region availability, and billing currency. The Offer ID parameter consists of the “MS-AZR-“ prefix, plus the Offer ID number.
考虑到优惠代码不会改变,我认为将此信息保存在您自己的数据库中是比较安全的
关于azure - 如何使用 API 获取 Azure 优惠详细信息?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32094080/