title: Azure Python SDK: Create budgets?
body: <p>I am trying to create budgets on my Azure subscription. First of all. I tried to use <a href="https://docs.microsoft.com/en-us/cli/azure/consumption/budget?view=azure-cli-latest" rel="nofollow noreferrer">Azure CLI</a> to create budgets.</p>
  <pre><code>az consumption budget create --amount
                               --budget-name
                               --category {cost, usage}
                               --end-date
                               --start-date
                               --time-grain {annually, monthly, quarterly}
  </code></pre>
  <p>I got the following error as a response: <code>Cost Management supports only Enterprise Agreement, Web direct and Microsoft Customer Agreement offer types</code>. I was not able to figure out what was the issue but I guess it is because our organization is using Azure Sponsorship.</p>
  <p>Then, I saw that Azure offers a <a href="https://docs.microsoft.com/en-us/rest/api/consumption/budgets/createorupdate" rel="nofollow noreferrer">budget REST API</a> with a PUT request that looks like this:</p>
  <pre><code>https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Consumption/budgets/TestBudget?api-version=2019-10-01
  </code></pre>
  <p>I am wondering if it's possible to create a budget using the <a href="https://azure.github.io/azure-sdk/releases/latest/mgmt/python.html" rel="nofollow noreferrer">Azure Python SDK</a>? There is a documentation for the <a href="https://docs.microsoft.com/en-us/python/api/overview/azure/billing?view=azure-python" rel="nofollow noreferrer">Python SDK billing</a> but no examples.</p>