首页 > 解决方案 > Azure Python SDK:创建预算?

问题描述

我正在尝试为我的 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 提供了一个带有 PUT 请求的预算 REST API,如下所示:

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 计费的文档,但没有示例。

标签: azure

解决方案



推荐阅读