【发布时间】:2021-05-08 13:01:50
【问题描述】:
我正在尝试为我的 Azure 订阅创建预算。首先。我尝试使用Azure CLI 来创建预算。
az consumption budget create --amount
--budget-name
--category {cost, usage}
--end-date
--start-date
--time-grain {annually, monthly, quarterly}
我收到以下错误作为响应:Cost Management supports only Enterprise Agreement, Web direct and Microsoft Customer Agreement offer types。我无法弄清楚问题出在哪里,但我猜这是因为我们的组织正在使用 Azure 赞助。
然后,我看到 Azure 提供了一个 budget REST API 和一个 PUT 请求,如下所示:
https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Consumption/budgets/TestBudget?api-version=2019-10-01
我想知道是否可以使用Azure Python SDK 创建预算? Python SDK billing 有一个文档,但没有示例。
【问题讨论】:
-
请检查您的订阅计划。如果计划不支持成本管理,那么您将无法使用 SDK 或 REST API 创建预算。
标签: azure