> ## Documentation Index
> Fetch the complete documentation index at: https://agno-v2.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Agent with Tools

> Maintain a classic AzureAIFoundry web-search agent while migrating to current Foundry inference.

> [!WARNING]
>
> `AzureAIFoundry` uses the retired `azure-ai-inference` SDK. Microsoft retired this SDK on May 30, 2026 and directs model inference to the OpenAI SDK. Use this page only for a classic deployment while you follow [Microsoft's Foundry migration guide](https://learn.microsoft.com/en-us/azure/foundry/how-to/navigate-from-classic#sdk-mapping).

## Code

```python tool_use.py theme={null}
from agno.agent import Agent
from agno.models.azure import AzureAIFoundry
from agno.tools.websearch import WebSearchTools

agent = Agent(
    model=AzureAIFoundry(id="Cohere-command-a"),
    tools=[WebSearchTools()],
    markdown=True,
)

agent.print_response("What is currently happening in France?", stream=True)
```

## Usage

<Snippet file="create-venv-step.mdx" />

**1. Create the model deployment**

In your classic Foundry project, deploy Cohere Command A with the deployment name `Cohere-command-a`. If you choose another deployment name, pass that exact name to `AzureAIFoundry(id=...)`.

**2. Set your API key**

```bash theme={null}
export AZURE_API_KEY=xxx
export AZURE_ENDPOINT=xxx
```

**3. Install dependencies**

```bash theme={null}
uv pip install -U azure-ai-inference aiohttp ddgs agno
```

**4. Run Agent**

Save the code above as `tool_use.py`, then run:

```bash theme={null}
python tool_use.py
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.