Azure Image Agent
Migrate an Azure AI Foundry image-URL 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.
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.
This source uses Agno's classic AzureAIFoundry adapter and the azure-ai-inference package, which Microsoft retired on August 26, 2026. Existing endpoint availability is separate from SDK retirement. For a new integration, use the current Foundry API setup with a compatible deployment. The classic setup below applies only to an existing compatible endpoint unless a current adaptation is explicitly provided.
"""
Azure Image Agent
=================
Cookbook example for `azure/ai_foundry/image_agent.py`.
"""
from agno.agent import Agent
from agno.media import Image
from agno.models.azure import AzureAIFoundry
# ---------------------------------------------------------------------------
# Create Agent
# ---------------------------------------------------------------------------
agent = Agent(
model=AzureAIFoundry(id="Llama-3.2-11B-Vision-Instruct"),
markdown=True,
)
agent.print_response(
"Tell me about this image.",
images=[
Image(
url="https://raw.githubusercontent.com/Azure/azure-sdk-for-python/main/sdk/ai/azure-ai-inference/samples/sample1.png",
detail="high",
)
],
stream=True,
)
# ---------------------------------------------------------------------------
# Run Agent
# ---------------------------------------------------------------------------
if __name__ == "__main__":
passRun the Classic Example
Set up your virtual environment
uv venv --python 3.12
source .venv/bin/activateInstall dependencies
uv pip install -U agno aiohttp azure-ai-inferenceExport environment variables
export AZURE_API_KEY="your_azure_api_key_here"
export AZURE_ENDPOINT="your_azure_endpoint_here"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.
Run the example
Save the code above as image_agent.py, then run:
python image_agent.pyFull source: cookbook/90_models/azure/ai_foundry/image_agent.py