> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agno.com/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).
</Warning>

## 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

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

  <Step title="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=...)`.
  </Step>

  <Step title="Set your API key">
    ```bash theme={null}
    export AZURE_API_KEY=xxx
    export AZURE_ENDPOINT=xxx
    ```
  </Step>

  <Step title="Install dependencies">
    ```bash theme={null}
    uv pip install -U azure-ai-inference aiohttp ddgs agno
    ```
  </Step>

  <Step title="Run Agent">
    Save the code above as `tool_use.py`, then run:

    ```bash theme={null}
    python tool_use.py
    ```
  </Step>
</Steps>
