April 1st, 2025

Getting Started with Claude models on Azure Databricks

Govind Kamtamneni
Technical Director, Global Black Belt

Introduction

Following up on the exciting announcement about Anthropic’s state-of-the-art models becoming available to Azure Databricks customers, this post provides a detailed, step-by-step guide on how you can start using Claude 3.7 Sonnet model directly within your Azure Databricks environment using Model Serving.

We’ll walk through deploying the necessary Azure Databricks workspace, finding the Claude 3.7 model endpoint, testing it in the Playground, and getting the code snippets needed to integrate it into your applications.

Prerequisites:

  • An active Azure subscription.

Image dbx title min

Step 1: Deploy a Premium Azure Databricks Workspace

First, you need an Azure Databricks workspace. Importantly, to use the Foundation Model APIs like Claude 3.7, you need a workspace on the Premium pricing tier located in a region that supports Model Serving.

  1. Check Region Availability: Before creating the workspace, verify that your desired Azure region supports Model Serving. You can find the latest list here: Azure Databricks Feature Region Support – Model Serving. Note that Pay-as-you-go model serving regions may differ slightly, check the documentation for specifics.
  2. Create Workspace: Navigate to the Azure portal to create a new Azure Databricks service: Create Azure Databricks Service.
  3. Configuration:
    • Select your subscription and resource group (or create a new one).
    • Enter a workspace name.
    • Choose a supported region (identified in step 1).
    • Crucially, select the ‘Premium’ Pricing Tier.
    • You can generally leave networking and other optional fields as default unless you have specific requirements. Image dbx resource
  4. Deploy: Review your settings and click “Create”. Provisioning may take a few minutes.

Step 2: Launch Workspace and Navigate to Model Serving

Once your Azure Databricks workspace is successfully provisioned:

  1. Go to the resource in the Azure portal.
  2. Click “Launch Workspace”.
  3. Inside Azure Databricks workspace, on the left sidebar under “Machine Learning”, click on “Serving”. Image dbx serving

Step 3: Explore Claude 3.7 Sonnet in the Playground

The Serving page lists available endpoints, including pre-provisioned foundation models.

  1. Locate the databricks-claude-3-7-sonnet endpoint in the list. (See image above)

  2. Click the “Use” button associated with the databricks-claude-3-7-sonnet model. This will take you directly to the AI Playground. Image dbx use model

  3. Test in Playground: The Playground provides an intuitive chat interface. You can type prompts directly into the chat box and interact with Claude 3.7 Sonnet to understand its capabilities and response style.

  4. Get Code Examples: To integrate the model into your applications, click the “Show code examples” button located in the top-left area of the Playground interface.

    Image dbx code sample

    This will reveal code snippets for making requests using curl and Python.

Step 4: Generate a Personal Access Token (PAT)

To authenticate your API requests from your code or REST client, you need a Databricks Personal Access Token (PAT).

  1. In the top-right corner of your Databricks workspace, click on your username/email address.
  2. Select “Settings” from the dropdown menu.
  3. Navigate to the “Developer” tab.
  4. Next to “Access tokens”, click the “Manage” button. Image dbx dev token
  5. Click “Generate new token”.
  6. Optionally, add a comment (e.g., “Claude API Access”) and set a lifetime for the token.
  7. Click “Generate”. Important: Copy the displayed token immediately and store it securely. You will not be able to see it again. Image dbx generate token
  8. Use this generated token as the value for DATABRICKS_TOKEN in the curl or Python code examples provided in Step 3.

Step 5: Test with an API Call

Now you can use the code examples from the Playground along with your PAT to interact with the model programmatically. Substitute $DATABRICKS_TOKEN with the PAT you just generated.

Here’s an example of what a curl request might look like (adapt the prompt as needed):

Bash

curl --request POST \
--url https://<your-workspace-instance>.azuredatabricks.net/serving-endpoints/databricks-claude-3-7-sonnet/invocations \
--header 'Authorization: Basic <Your_Base64_Encoded_token:PAT_String>' \
--header 'Content-Type: application/json' \
--data '{"messages":[{"role":"user","content":"How is Azure Databricks Billed?"}]}'

You can run this from your terminal or adapt the Python snippet for use in your application.

Image dbx request

Conclusion

Azure Databricks makes accessing powerful foundation models like Anthropic’s Claude 3.7 Sonnet incredibly straightforward. By leveraging the built-in Model Serving capabilities and the AI Playground, you can quickly go from deploying your workspace to testing and integrating cutting-edge AI into your workflows. This seamless integration empowers data scientists and developers to build sophisticated AI applications directly on their data platform. Start exploring Claude 3.7 on Azure Databricks today!


Author

Govind Kamtamneni
Technical Director, Global Black Belt

0 comments

Leave a comment

Your email address will not be published. Required fields are marked *