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: 

Unable to create Cluster via REST API

jeffn
New Contributor

I have tried all 3 of the example payloads listed here to create a Compute Cluster: https://docs.databricks.com/api/azure/workspace/clusters/create

All return the same error: Invalid JSON given in the body of the request - expected a map

Other Compute Cluster REST APIs work just fine (List clusters, etc). Also, this documentation seems to be incorrect for the Azure flavor of Databricks. Has anyone else run into this issue and solved it?




 

1 REPLY 1

Panda
Valued Contributor

@jeffn  - I was able to successfully create a cluster using the same Azure documentation, both via the REST API and the Databricks SDK. Hopefully it helps.

from databricks.sdk import WorkspaceClient
from databricks.sdk.service.compute import CreateCluster
w = WorkspaceClient(
    host="<workspace_url>",
    token="<databricks_token>"
)

cluster = w.clusters.create(
    cluster_name="test-cluster-api",
    spark_version="14.3.x-scala2.12",
    node_type_id="Standard_DS3_v2",
    driver_node_type_id="Standard_DS3_v2",
    num_workers=1,
    autotermination_minutes=30,
)

 

Join Us as a Local Community Builder!

Passionate about hosting events and connecting people? Help us grow a vibrant local community—sign up today to get started!

Sign Up Now