This page covers all LangChain integrations with Microsoft Azure and other Microsoft products.Documentation Index
Fetch the complete documentation index at: https://docs.langchain.com/llms.txt
Use this file to discover all available pages before exploring further.
Claude on AzureMicrosoft Foundry also offers access to all Anthropic Claude models, including Opus, Sonnet, and Haiku. Claude models are served through a dedicated Anthropic-native endpoint rather than the Azure OpenAI v1 API. Use
langchain-anthropic pointed at your Foundry Anthropic endpoint.Chat models
Microsoft offers three main options for accessing chat models through Azure:-
Azure OpenAI (recommended) — Access any model deployed in Microsoft Foundry (including OpenAI, Llama, DeepSeek, Mistral, and Phi) through a single interface, with enterprise features such as keyless authentication through Microsoft Entra ID, regional data residency, and private networking. Use
ChatOpenAIon the v1 API, orAzureChatOpenAIfor traditional deployments. Azure OpenAI also supports the Responses API, which gives you access to server-side tools like code interpreter, image generation, and file search directly from your chat model. - Azure AI — Recommended for accessing tools, storage, and custom middleware from the broader Azure ecosystem alongside your chat model.
- Azure ML — Allows deployment and management of custom or fine-tuned open-source models with Azure Machine Learning.
Azure OpenAI
To get started with Azure OpenAI, create an Azure deployment and install thelangchain-openai package:
ChatOpenAI directly against your Azure endpoint—no api_version required:
- Entra ID (recommended)
- API key
AzureChatOpenAI:
Responses API
Azure OpenAI supports the Responses API, which provides stateful conversations, built-in tools (web search, file search, code interpreter), and structured reasoning summaries.ChatOpenAI automatically routes to the Responses API when you set the reasoning parameter, or you can opt in explicitly with use_responses_api=True:
- Entra ID (recommended)
- API key
Azure AI
Azure AI Foundry is the broader Azure AI platform. Thelangchain-azure-aipackage lets you bring Azure-native tools, storage, and custom middleware into your LangChain app, and exposes chat models deployed in Foundry through theAzureAIOpenAIApiChatModelclass.
LLMs
Microsoft offers two main options for accessing LLMs through Azure:- Azure OpenAI (recommended) — Access any model deployed in Microsoft Foundry (including OpenAI, Llama, DeepSeek, Mistral, and Phi) as a completion LLM with
AzureOpenAI. - Azure ML — Use custom or open-source models hosted on Azure Machine Learning online endpoints.
Azure OpenAI
See a usage example.- Entra ID (recommended)
- API key
Embedding models
Microsoft offers two main options for accessing embedding models through Azure:- Azure OpenAI (recommended) — Use embedding models deployed in Microsoft Foundry (including OpenAI
text-embedding-3-small,text-embedding-3-large, and Cohere) withAzureOpenAIEmbeddings. - Azure AI — Recommended for accessing tools, storage, and custom middleware from the broader Azure ecosystem alongside your embedding model.
Azure OpenAI
See a usage example.- Entra ID (recommended)
- API key
Azure AI
Middleware
Azure AI Content Safety middleware
Azure AI Content Safety provides guardrails you can apply to LangChain agents through middleware. The langchain-azure-ai package currently exports middleware for text moderation, image moderation, prompt injection detection, protected material detection, and groundedness evaluation.
Install the middleware package:
Document loaders
Azure Blob Storage
Azure Blob Storage is Microsoft’s object storage solution for the cloud. Blob Storage is optimized for storing massive amounts of unstructured data. Unstructured data is data that doesn’t adhere to a particular data model or definition, such as text or binary data.
Azure Blob Storage is designed for:
- Serving images or documents directly to a browser.
- Storing files for distributed access.
- Streaming video and audio.
- Writing to log files.
- Storing data for backup and restore, disaster recovery, and archiving.
- Storing data for analysis by an on-premises or Azure-hosted service.
Memory
Azure cosmos DB chat message history
Azure Cosmos DB provides chat message history storage for conversational AI applications, enabling you to persist and retrieve conversation history with low latency and high availability.
AsyncCosmosDBChatMessageHistory from the same package.
Azure cosmos DB semantic cache
AzureCosmosDBNoSqlSemanticCache caches LLM responses in Azure Cosmos DB for NoSQL using vector similarity, returning cached results when a semantically similar prompt is seen again.
AsyncAzureCosmosDBNoSqlSemanticCache.
Vector stores
Azure cosmos DB
AI agents can rely on Azure Cosmos DB as a unified memory system solution, enjoying speed, scale, and simplicity. This service successfully enabled OpenAI’s ChatGPT service to scale dynamically with high reliability and low maintenance. Powered by an atom-record-sequence engine, it is the world’s first globally distributed NoSQL, relational, and vector database service that offers a serverless mode. Below are two available Azure Cosmos DB APIs that can provide vector store functionalities.Azure cosmos DB for MongoDB (vCore)
Azure Cosmos DB for MongoDB vCore makes it easy to create a database with full native MongoDB support. You can apply your MongoDB experience and continue to use your favorite MongoDB drivers, SDKs, and tools by pointing your application to the API for MongoDB vCore account’s connection string. Use vector search in Azure Cosmos DB for MongoDB vCore to seamlessly integrate your AI-based applications with your data that’s stored in Azure Cosmos DB.
Installation and setup
See detailed configuration instructions. We need to installlangchain-azure-ai and pymongo python packages.
Deploy Azure cosmos DB on Microsoft Azure
Azure Cosmos DB for MongoDB vCore provides developers with a fully managed MongoDB-compatible database service for building modern applications with a familiar architecture. With Cosmos DB for MongoDB vCore, developers can enjoy the benefits of native Azure integrations, low total cost of ownership (TCO), and the familiar vCore architecture when migrating existing applications or building new ones. Sign Up for free to get started today. See a usage example.Azure cosmos DB NoSQL
Azure Cosmos DB for NoSQL now offers vector indexing and search in preview. This feature is designed to handle high-dimensional vectors, enabling efficient and accurate vector search at any scale. You can now store vectors directly in the documents alongside your data. This means that each document in your database can contain not only traditional schema-free data, but also high-dimensional vectors as other properties of the documents. This colocation of data and vectors allows for efficient indexing and searching, as the vectors are stored in the same logical unit as the data they represent. This simplifies data management, AI application architectures, and the efficiency of vector-based operations.
Installation and setup
See detail configuration instructions. We need to installlangchain-azure-cosmosdb and azure-cosmos python packages.
Deploy Azure cosmos DB on Microsoft Azure
Azure Cosmos DB offers a solution for modern apps and intelligent workloads by being very responsive with dynamic and elastic autoscale. It is available in every Azure region and can automatically replicate data closer to users. It has SLA guaranteed low-latency and high availability. Sign Up for free to get started today. See a usage example.Azure Database for PostgreSQL
Azure Database for PostgreSQL - Flexible Server is a relational database service based on the open-source Postgres database engine. It’s a fully managed database-as-a-service that can handle mission-critical workloads with predictable performance, security, high availability, and dynamic scalability.See set up instructions for Azure Database for PostgreSQL. Simply use the connection string from your Azure Portal. Since Azure Database for PostgreSQL is open-source Postgres, you can use the LangChain’s Postgres support to connect to Azure Database for PostgreSQL.
Azure SQL Database
Azure SQL Database is a robust service that combines scalability, security, and high availability, providing all the benefits of a modern database solution. It also provides a dedicated Vector data type & built-in functions that simplifies the storage and querying of vector embeddings directly within a relational database. This eliminates the need for separate vector databases and related integrations, increasing the security of your solutions while reducing the overall complexity.By leveraging your current SQL Server databases for vector search, you can enhance data capabilities while minimizing expenses and avoiding the challenges of transitioning to new systems.
Installation and setup
See detail configuration instructions. We need to install thelangchain-sqlserver python package.
Deploy Azure SQL DB on Microsoft Azure
Sign Up for free to get started today. See a usage example.Vector store
Azure Database for PostgreSQL
Azure Database for PostgreSQL - Flexible Server is a relational database service based on the open-source Postgres database engine. It’s a fully managed database-as-a-service that can handle mission-critical workloads with predictable performance, security, high availability, and dynamic scalability.See set up instructions for Azure Database for PostgreSQL. You need to enable pgvector extension in your database to use Postgres as a vector store. Once you have the extension enabled, you can use the PGVector in LangChain to connect to Azure Database for PostgreSQL. See a usage example. Simply use the connection string from your Azure Portal.
Tools
Azure Container apps dynamic sessions
We need to get thePOOL_MANAGEMENT_ENDPOINT environment variable from the Azure Container Apps service.
See the Azure dynamic sessions setup instructions.
We need to install a python package.
Connect these docs to Claude, VSCode, and more via MCP for real-time answers.

