cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

Can I create a serverless budget policy via Python SDK on Azure Databricks?

ScottH
New Contributor III

Hi, I am trying to use the Databricks Python SDK (v0.74.0) to automate the creation of budget policies in our Databricks account. See the Python code below where I am trying to create a serverless budget policy. Note the error.

When I click the "Diagnose error" button, the Databricks Assistant provides the following information:

The error NotFound: Bad Target: /api/2.1/accounts/.../budget-policies indicates that the API endpoint you are calling does not exist or is not enabled for your account. This is likely because serverless budget policies are only available for specific resources (like serverless compute or Mosaic AI Vector Search endpoints), and you must have the correct permissions and use the correct API or SDK method to create them

To fix this:

  1. Ensure you are a workspace admin and have the Billing admin account-level role in the Databricks account console.
  2. Double-check that your use case is supported (e.g., serverless compute or Vector Search endpoints).
  3. If you are trying to set a budget policy for a Vector Search endpoint, use the correct SDK or REST API as described in the documentation.
  4. If you are not working with serverless compute or Vector Search, budget policies may not be available for your resource.

    I can create a serverless budget policy via the Databricks UI. I am on the Azure Databricks platform. I have the account admin and billing admin roles at the account level. I am a workspace admin. Is it not possible to create a serverless budget policy via the Python SDK? It seems the backend API endpoint does not exist in our environment. Anyone else run into this issue?

     

ScottH_0-1766168891911.png

0 REPLIES 0