Skip to main content
In this lesson you’ll learn how to integrate Azure AI Language capabilities into an AI agent so the agent can better understand, analyze, and safely handle human language. This enables the agent to offload specialized text tasks—like language detection, named entity recognition, and PII redaction—to Azure services instead of implementing them itself. Think of the agent as a smart assistant that reasons and plans, and of tools (like Azure AI Language) as specialized capabilities the agent invokes when needed. In this scenario there are three primary components:
  • Foundry agent — the agent that interacts with users and decides which actions (tool calls) are needed to complete a task.
  • MCP server — the Model Context Protocol server provides a standardized way for agents to discover and call tools; it acts as the bridge between the agent and external capabilities.
  • Azure AI Language — a suite of language-processing services that perform language detection, named entity recognition, PII detection/redaction, and other text analytics.
For example, given the user sentence: “Alex and I attended a Microsoft AI conference in Las Vegas on September 21st.” the agent can call Azure AI Language to:
  • detect the language,
  • extract entities such as names, locations, and dates (named entity recognition),
  • detect and redact personal data such as email addresses or SSNs (PII detection/redaction).
Delegating these tasks to Azure AI Language ensures higher accuracy, consistent outputs, and reduced risk for the agentic application.
A slide titled "Using Azure AI Language in an AI Agent" that diagrams a flow from Foundry Agent → MCP Server → Azure AI Language. It also lists agent-invokable capabilities such as language detection, named entity recognition, and PII detection/redaction.
How the agent calls tools
  • The agent constructs a structured request (a tool invocation) and sends it to the MCP server.
  • The MCP server routes the request to the configured external capability (Azure AI Language).
  • The tool returns structured results (e.g., detected language, entity list, redacted text) that the agent uses in its reasoning and responses.
Permission models for tool invocations When an agent is connected to tools, you must decide how the agent is allowed to invoke them. Choose a model based on trust, security, and the sensitivity of processed data:
Prefer the least-privilege permission model that still enables smooth operation. For workflows that redact or manipulate PII, require at least per-call or per-tool approval.
Example: Named entity extraction Below is an example of a function-style request payload the agent might send to extract named entities from text:
Configuring the agent in Foundry In the Foundry UI you configure the agent’s model, system instructions, and tools. Use the chat/testing pane to interact with and validate the agent’s behavior. Agent configuration checklist:
  • Model: choose an LLM (for example, GPT-4.1 or GPT-4.1-mini).
  • Instructions: supply system instructions describing the agent’s role; e.g., “You are a text-analyzing agent. Use Azure Language tools to detect language, identify and redact PII, and return a redacted version of the text.”
  • Tools: add the Azure Language tool (or other tools) to the agent’s toolset.
  • Knowledge: optionally attach documents (PDFs, internal docs) the agent can reference for context.
A screenshot of the Microsoft Foundry/Azure AI agent Playground for an agent named "ai901." The left column shows model settings, instructions and tools, while the right side is a large empty chat/testing pane.
Adding Azure Language to Foundry To add the Azure Language tool in Foundry:
  1. Choose Add Tools and search the catalog for Azure resources.
  2. Select the Azure Language / Foundry Tools entry and provide the resource name and key.
Example configuration values (wrap these as secure config when adding them):
You can copy the Foundry resource name and API key from the Azure portal’s Language service pages: https://learn.microsoft.com/azure/ai-services/language/
A screenshot of the Microsoft Foundry/Azure web interface showing the "Azure Language - Language Detection" playground. A modal overlays the page displaying an endpoint URL and a concealed API key, with configuration options and a large area to add text for language detection.
Example: PII redaction A common step is to redact PII before storing or forwarding user content. Here is an example request an agent might invoke to redact PII from a user’s message:
When the agent invokes redaction, the request will be subject to the configured permission model (one-time, per-tool, or allow-all). After approval, the Azure Language tool returns a sanitized version of the text, and the agent can proceed knowing sensitive data is protected. Simplified example interaction: User: My name is Sarah and my email is sarah@yahoo.com
Agent: Calling Azure Language redaction…
(redaction request approved)
Agent: I have redacted your personal information for privacy. If you need any help or have questions, feel free to ask!
Putting it together: a safe text-processing workflow A typical workflow when combining tools looks like this:
  1. Agent receives user content.
  2. Agent calls Azure Language to redact PII and/or extract structured data (entities, dates, locations).
  3. Agent stores sanitized data in a database or takes other actions (e.g., search, task automation).
  4. Agent responds to the user, optionally summarizing extracted insights without exposing raw PII.
This pattern keeps sensitive data protected and improves the agent’s analytic accuracy by leveraging Azure’s specialized text-processing capabilities. References and further reading Conclusion Integrating Azure AI Language into an agentic architecture lets your agent focus on reasoning and orchestration while delegating text analysis to a specialized service. Use conservative permissions, validate outputs in Foundry’s testing pane, and always sanitize sensitive data before storage or further processing. This concludes the lesson on using language capabilities in an agent.

Watch Video