Azure OpenAI Service provides access to OpenAI’s powerful language models through Microsoft Azure’s enterprise-grade infrastructure. This integration allows you to use your Azure OpenAI deployments directly in Cargo workflows, ideal for organizations with compliance, data residency, or security requirements.
How to set up Azure OpenAI
Azure OpenAI requires your own Azure credentials (BYOC). Cargo credits are not available for this integration.
Prerequisites
Before connecting, ensure you have:
- An active Azure subscription
- An Azure OpenAI resource created in the Azure Portal
- At least one model deployment in your Azure OpenAI resource
Connection details
| Field | Description |
|---|
| Resource Name | Your Azure OpenAI resource name (e.g., my-company-openai) |
| API Key | Your Azure OpenAI API key from the Azure Portal |
| API Version | Optional. Defaults to 2024-08-01-preview |
Finding your credentials
Resource Name
- Go to the Azure Portal
- Navigate to your Azure OpenAI resource
- The resource name is in the overview page and part of your endpoint URL
- If your endpoint is
https://my-company-openai.openai.azure.com/, your resource name is my-company-openai
API Key
- In the Azure Portal, navigate to your Azure OpenAI resource
- Click Keys and Endpoint under “Resource Management”
- Copy KEY 1 or KEY 2
Find your API key and endpoint in the Azure Portal under your Azure OpenAI resource → Keys and Endpoint.
Azure OpenAI actions
Instruct
Send a prompt to an Azure OpenAI deployment and receive a text response.
Use cases
- Content generation – Generate personalized emails, messages, or content
- Classification – Categorize text into predefined categories
- Summarization – Summarize long text into concise summaries
- Data extraction – Extract structured data from unstructured text
- Translation – Translate text between languages
- Analysis – Analyze sentiment, intent, or other text properties
Configuration
| Field | Description |
|---|
| Deployment Name | The name of your Azure OpenAI deployment |
| Prompt | The prompt to send to the model |
| System prompt | Optional system instructions |
| Maximum tokens | Limit output length |
| Temperature | Control randomness (0 = deterministic, 2 = very random) |
| Response format | Text, JSON object, or JSON schema |
Azure OpenAI uses deployment names instead of model names. You define these names when deploying models in the Azure Portal.
Understanding deployments
Unlike standard OpenAI where you select models like gpt-4o, Azure OpenAI requires you to:
- Deploy a model in the Azure Portal
- Give it a custom deployment name (e.g.,
my-gpt4o-deployment)
- Use that deployment name in Cargo
To find your deployment names:
- Go to your Azure OpenAI resource in the Azure Portal
- Click Model deployments in the left sidebar
- Note the Deployment name for each model
Control how the model returns its response:
| Format | Description |
|---|
| Text | Free-form text response (default) |
| JSON object | Response formatted as valid JSON |
| JSON schema | Response validated against a specific JSON schema |
Use JSON schema when you need structured output with specific fields.
Define your schema to ensure consistent, parseable responses.
Example JSON schema
{
"type": "object",
"properties": {
"sentiment": { "type": "string", "enum": ["positive", "negative", "neutral"] },
"confidence": { "type": "number" },
"summary": { "type": "string" }
},
"additionalProperties": false,
"required": ["sentiment", "confidence", "summary"]
}
Advanced settings
System prompt
Set instructions that guide the model’s behavior across all prompts:
- Define the model’s role or persona
- Set output format guidelines
- Provide context about your use case
- Establish constraints or rules
Temperature
Control the randomness of outputs:
| Temperature | Behavior |
|---|
| 0 | Most deterministic, consistent outputs |
| 0.5-1 | Balanced creativity and consistency |
| 1-2 | More creative, varied outputs |
For tasks requiring consistency (classification, extraction), use low
temperature (0-0.3). For creative tasks (content generation), use higher
temperature (0.7-1).
API versions
Azure OpenAI requires an API version. Cargo defaults to 2024-08-01-preview. If you need specific features, you can override it:
| Version | Description |
|---|
2024-08-01-preview | Latest preview (default) |
2024-06-01 | Latest stable version |
2024-02-01 | Older stable version |
Troubleshooting
”DeploymentNotFound” error
The deployment name you specified doesn’t exist. Verify:
- The deployment name matches exactly as shown in the Azure Portal
- The deployment is in the same resource you configured
”Unauthorized” error
Your credentials may be incorrect. Check that:
- Your API key is correct and hasn’t been regenerated
- Your Azure OpenAI resource is active
- The API key has access to the specified resource