Deploy and use Claude models in Microsoft Foundry

Purpose & Scope

Summary on deploying and using Anthropic’s Claude models within Microsoft Foundry, which enhances applications with advanced conversational AI capabilities.

Value Proposition

Utilizing Claude models allows developers to create intelligent applications that leverage state-of-the-art language understanding and generation, improving user interaction and application functionality.

Quick Summary

  • Prerequisites: Requires an Azure subscription, access to Microsoft Foundry, and specific permissions.
  • Deployment: Instructions for deploying Claude models in Microsoft Foundry, including using a starter kit for quick setup.
  • Authentication: Details on authenticating using Microsoft Entra ID or API keys.
  • API Usage: Steps to call the Claude Messages API using Python, JavaScript, or REST, including example code snippets.
  • Troubleshooting: Common errors and solutions related to using Claude models in Foundry.

Anthropic’s Claude models bring advanced conversational AI capabilities to Microsoft Foundry, enabling you to build intelligent applications with state-of-the-art language understanding and generation. Claude models excel at complex reasoning, code generation, and multimodal tasks including image analysis.

  • Deploy Claude models in Microsoft Foundry
  • Authenticate by using Microsoft Entra ID or API keys
  • Call the Claude Messages API from Python, JavaScript, or REST

For the full list of available Claude models, capabilities, quotas, and billing, see Claude models in Microsoft Foundry.

Prerequisites

Subscription type and region support

To use Claude models in Microsoft Foundry, you must have a paid Azure subscription with a billing account in a country or region where Anthropic offers the models for purchase. For a list of common subscription-related errors, see Common error messages and solutions. The following subscription types are currently not supported:

  • Enterprise Accounts located in South Korea
  • Cloud Solution Provider subscriptions
  • Azure subscriptions that don’t have an active pay-as-you-go billing method (for example, student, free trial, or startup credit–based accounts)
  • Sponsored subscriptions that only use Azure credits. Note: If you have an account with a credit card on file, the credit card will be charged instead of Azure Credits.

For a list of supported regions, see supported geographic locations. Note that, Anthropic’s “Supported Regions Policy” may apply for the availability in your region, check supported regions for details.

Use the Claude on Foundry starter kit

To get started with Claude on Foundry quickly, use the Claude on Foundry starter kit. The starter kit uses a single azd up command to provision a Foundry account, project, and your chosen Claude model deployments by using either Bicep or Terraform. It then wires the Anthropic SDK and the Claude Code CLI to call your deployment over Microsoft Entra ID, with no API keys to manage.

Deploy Claude models

Claude models in Foundry are available for global standard deployment. To deploy a Claude model, follow the instructions in Deploy Microsoft Foundry Models in the Foundry portal.

After deployment, use the Foundry playground to interactively test the model.

Call the Claude Messages API

After you deploy a Claude model, interact with it to generate text responses:

  • Use the Anthropic SDKs and the following Claude APIs:
    • Messages API: Send a structured list of input messages with text or image content. The model generates the next message in the conversation.
    • Token Count API: Count the number of tokens in a message.
    • Files API: Upload and manage files for use with the Claude API without re-uploading content with each request.
    • Skills API: Create custom skills for Claude AI.

Send messages with authentication

The following examples show how to send requests to Claude Sonnet 4.6 using Microsoft Entra ID or API key authentication. To work with your deployed model, you need:

  • Your base URL, which is of the form https://<resource name>.services.ai.azure.com/anthropic.
  • Your target URI from your deployment details, which is of the form https://<resource name>.services.ai.azure.com/anthropic/v1/messages.
  • Microsoft Entra ID for keyless authentication or your deployment’s API key for API authentication.
  • Deployment name you chose during deployment creation. This name can be different from the model ID.

For advanced features and capabilities of Claude models, see Claude models in Microsoft

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.