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

# Azure OpenAI

> Legacy AzureOpenAITools reference for image generation with retired DALL-E deployments.

<Warning>
  Azure DALL-E 2 and DALL-E 3 deployments are retired. The v2.7.2 `AzureOpenAITools` implementation supports only those models, so this example no longer runs against a current Azure image model. See [Microsoft's migration guidance](https://learn.microsoft.com/en-us/azure/foundry/openai/how-to/dall-e).
</Warning>

## Legacy Requirements

This legacy example requires `requests`, `AZURE_OPENAI_API_KEY`, `AZURE_OPENAI_ENDPOINT`, and `AZURE_OPENAI_IMAGE_DEPLOYMENT`. `AZURE_OPENAI_API_VERSION` is optional and defaults to `2023-12-01-preview`. The standard-model path also uses `OPENAI_API_KEY`; the full-Azure path uses `AZURE_OPENAI_DEPLOYMENT`.

## Legacy Example

The pinned agent used Azure OpenAI DALL-E for image generation:

```python theme={null}
from agno.agent import Agent
from agno.tools.models.azure_openai import AzureOpenAITools

agent = Agent(
    instructions=[
        "You are an AI image generation assistant using Azure OpenAI",
        "Generate high-quality images based on user descriptions",
        "Provide detailed descriptions of the generated images",
    ],
    tools=[AzureOpenAITools()],
)

agent.print_response("Generate an image of a sunset over mountains", stream=True)
```

## Toolkit Params

| Parameter               | Type            | Default                | Description                                                            |
| ----------------------- | --------------- | ---------------------- | ---------------------------------------------------------------------- |
| `api_key`               | `Optional[str]` | `None`                 | Azure OpenAI API key. Uses AZURE\_OPENAI\_API\_KEY if not set.         |
| `azure_endpoint`        | `Optional[str]` | `None`                 | Azure OpenAI endpoint. Uses AZURE\_OPENAI\_ENDPOINT if not set.        |
| `api_version`           | `Optional[str]` | `"2023-12-01-preview"` | Azure OpenAI API version. Uses AZURE\_OPENAI\_API\_VERSION if not set. |
| `image_deployment`      | `Optional[str]` | `None`                 | DALL-E deployment name. Uses AZURE\_OPENAI\_IMAGE\_DEPLOYMENT.         |
| `image_model`           | `str`           | `"dall-e-3"`           | DALL-E model to use (dall-e-2, dall-e-3).                              |
| `image_quality`         | `Literal`       | `"standard"`           | Image quality: "standard" or "hd" (hd only for dall-e-3).              |
| `enable_generate_image` | `bool`          | `True`                 | Enable the generate image functionality                                |
| `all`                   | `bool`          | `False`                | Enable all functionality when set to True                              |

## Toolkit Functions

| Function         | Description                                       |
| ---------------- | ------------------------------------------------- |
| `generate_image` | Generate images using Azure OpenAI DALL-E models. |

## Developer Resources

* [Tools Source](https://github.com/agno-agi/agno/blob/main/libs/agno/agno/tools/models/azure_openai.py)
* [Azure image-generation migration guidance](https://learn.microsoft.com/en-us/azure/foundry/openai/how-to/dall-e)
