Skip to main content

Connect to Azure OpenAI

Azure OpenAI Service provides REST API access to advanced AI models with enterprise-grade security, compliance, and regional availability. You can create an Azure OpenAI resource so you can build AI-powered apps and workflows while maintaining data residency and leveraging Azure's infrastructure.

What you can do with Azure OpenAI in Retool

After you create an Azure OpenAI resource in Retool, you can:

  • Generate, summarize, classify, and extract information from text using GPT models deployed in your Azure environment.
  • Build conversational, multi-turn chat experiences with context-aware responses.
  • Maintain data residency and compliance by processing requests within your own Azure infrastructure.

Supported models

Azure OpenAI resources require you to bring your own key for authentication. Retool-managed keys aren't available for Azure OpenAI.

The following models are available with your own API key:

ModelResource queriesAgent supportAssist support
Azure OpenAI Deployment

Azure OpenAI provides access to OpenAI models deployed in Azure regions. You can use any OpenAI model you have deployed in your Azure OpenAI resource, including:

  • All GPT models (GPT-5.x, GPT-4.x, GPT-4o, etc.).
  • o-series reasoning models.
  • DALL·E image generation models.
  • Embedding models.
  • Fine-tuned models.
  • Regional model variants.

When configuring queries in Retool, specify the deployment name you created in Azure, not the underlying model ID. Deployment names are configured when you create model deployments in the Azure portal.

Model deployments required

You must create model deployments in your Azure OpenAI resource before using them in Retool. Refer to Azure OpenAI deployment documentation and model availability for details on which models are available in your region.

Before you begin

Before creating an Azure OpenAI resource, you need:

  • Retool permissions: Ability to create and manage resources in your Retool organization.
  • Azure OpenAI access: An Azure subscription with Azure OpenAI Service enabled.
  • Model deployments: At least one model deployed in your Azure OpenAI resource.
  • API key: An API key from your Azure OpenAI resource.
  • Endpoint URL: The endpoint URL for your Azure OpenAI resource (e.g., https://your-resource-name.openai.azure.com).

Create an Azure OpenAI resource

Create a resource to connect Retool to Azure OpenAI and configure authentication. Once connected, you can then select it when writing queries to make use of its available models.

Follow these steps to create an Azure OpenAI resource in Retool.

Create a new resource

Navigate to Resources in the main navigation and click Create new > Resource. Search for Azure OpenAI. Then, click the Azure OpenAI tile to create a new resource.

Configure connection settings

Specify a name for the resource that identifies it within your organization. Include a description that can provide more context to users and Assist about how to use the resource.

Configure authentication

Bring your own key only

This resource requires you to provide your own API key. Retool-managed keys are not available for Azure OpenAI.

Azure OpenAI resources require an API key and endpoint configuration.

  1. Endpoint URL: Your Azure OpenAI resource endpoint (e.g., https://your-resource-name.openai.azure.com).
  2. API Key: Your Azure OpenAI API key. Retrieve this from the Keys and Endpoint section in your Azure OpenAI resource in the Azure portal.
  3. API Version: The Azure OpenAI API version to use (e.g., 2024-02-15-preview). Leave blank to use the default stable version. Only set this if you need a specific API version.
  4. Deployment Names: Specify the names of your model deployments. You'll reference these deployment names when creating queries.

Retrieve your endpoint URL and API key from the Azure portal by navigating to your Azure OpenAI resource and selecting Keys and Endpoint.

Secure your API keys

Create dedicated API keys for Retool to best manage and revoke access without disruption. All API keys used with Retool are encrypted and stored securely.

Save the resource

Click Create resource to save your Azure OpenAI resource. The resource is now available for use in apps and workflows.

Note

AI resources do not have a Test connection button. To verify your configuration, create a new app and ask the agent to test the resource for you.

Interact with Azure OpenAI data

Once you've created an Azure OpenAI resource, you can interact with GPT models using Retool.

Switch to the new app builder

Retool recommends using the new app builder so you can use natural language to build React-based apps using AI.

  • To use Azure OpenAI models in the app builder, reference the resource in the prompt with @, such as @Azure OpenAI. Refer to the data and functions documentation to learn more.
  • For classic apps, workflows, and agents, refer to the AI queries documentation to learn how to write a resource query.

Best practices

Follow these best practices to keep your Azure OpenAI usage secure and cost-efficient.

Security

  • Rotate credentials regularly: Roll your Azure OpenAI API key periodically from the Keys and Endpoint section of your Azure OpenAI resource in the Azure portal, and immediately if a key is ever exposed.
  • Create separate API keys for Retool: Use a dedicated Azure OpenAI key for Retool so you can revoke or rotate access without disrupting other integrations.
  • Use resource environments: Organizations on an Enterprise plan can configure multiple resource environments to maintain separate Azure OpenAI deployments for production, staging, and development.

Manage token usage and cost

  • Choose the smallest capable deployment: Deploy and use a faster, cheaper model (e.g. GPT-4.1 Nano) for simple tasks like classification or extraction, and reserve larger models for tasks that need deeper reasoning.
  • Set output token limits: Configure a maximum output token limit appropriate to the task to avoid paying for unnecessarily long responses.
  • Trim conversation history: For chat use cases, truncate or summarize older messages instead of sending the full history on every request. Azure OpenAI bills for all input tokens, including message history.
  • Monitor usage: Track token consumption and spend in Azure Cost Management to catch unexpected usage spikes early.