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

# Azure Image Agent Bytes

> Migrate an Azure AI Foundry image-bytes agent from retired Llama 3.2 Vision to Llama 4 Scout.

The source-fidelity code uses a retired Azure AI Foundry model. Replace it with Llama 4 Scout before running the example.

<Warning>
  Microsoft retired `Llama-3.2-11B-Vision-Instruct` on June 13, 2026. Deploy `Llama-4-Scout-17B-16E-Instruct`, point `AZURE_ENDPOINT` at that deployment, and replace the model ID before running. See the [Azure model retirement schedule](https://learn.microsoft.com/en-us/azure/foundry/openai/concepts/model-retirement-schedule?view=foundry-classic).
</Warning>

```python image_agent_bytes.py theme={null}
"""
Azure Image Agent Bytes
=======================

Cookbook example for `azure/ai_foundry/image_agent_bytes.py`.
"""

from pathlib import Path

from agno.agent import Agent
from agno.media import Image
from agno.models.azure import AzureAIFoundry
from agno.utils.media import download_image

# ---------------------------------------------------------------------------
# Create Agent
# ---------------------------------------------------------------------------

agent = Agent(
    model=AzureAIFoundry(id="Llama-3.2-11B-Vision-Instruct"),
    markdown=True,
)

image_path = Path(__file__).parent.joinpath("sample.jpg")

download_image(
    url="https://upload.wikimedia.org/wikipedia/commons/0/0c/GoldenGateBridge-001.jpg",
    output_path=str(image_path),
)

# Read the image file content as bytes
image_bytes = image_path.read_bytes()

agent.print_response(
    "Tell me about this image.",
    images=[
        Image(content=image_bytes),
    ],
    stream=True,
)

# ---------------------------------------------------------------------------
# Run Agent
# ---------------------------------------------------------------------------

if __name__ == "__main__":
    pass
```

## Run the Example

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

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

  <Step title="Export environment variables">
    <CodeGroup>
      ```bash Mac/Linux theme={null}
      export AZURE_API_KEY="your_azure_api_key_here"
      export AZURE_ENDPOINT="your_azure_endpoint_here"
      ```

      ```bash Windows theme={null}
      $Env:AZURE_API_KEY="your_azure_api_key_here"
      $Env:AZURE_ENDPOINT="your_azure_endpoint_here"
      ```
    </CodeGroup>
  </Step>

  <Step title="Use Llama 4 Scout">
    Deploy `Llama-4-Scout-17B-16E-Instruct`, update `AZURE_ENDPOINT`, and replace `Llama-3.2-11B-Vision-Instruct` in the saved file.
  </Step>

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

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

Full source: [cookbook/90\_models/azure/ai\_foundry/image\_agent\_bytes.py](https://github.com/agno-agi/agno/blob/main/cookbook/90_models/azure/ai_foundry/image_agent_bytes.py)
