Use Azure OpenAI in a Studio operation in Jitterbit Studio
Introduction
The Azure OpenAI connector lets Studio operations send data to an Azure-hosted language model and receive AI-generated text in return. This guide covers the common pattern of constructing a prompt from source data, sending it to Azure OpenAI using the Prompt activity, and then routing the AI response to a downstream target such as a database, a file, or a notification channel.
Unlike the OpenAI connector, the Azure OpenAI connector authenticates using an Azure resource endpoint URL and API key rather than an OpenAI account key, and models are selected from the deployments in your Azure OpenAI resource rather than from a fixed list.
Design pattern
The operation that submits data to Azure OpenAI follows the transformation pattern:
Map AI response"] --> E[Target activity]
The source activity provides the data used to build the prompt (for example, a database query result or a Salesforce record). The transformation maps that data into the prompt request fields. The Prompt activity sends the request to Azure OpenAI and stores the response.
A second operation, chained on the success of the first, uses a transformation to read the AI response and route the generated text to the target activity (for example, writing it to a database field or posting it to a Slack channel).
Part 1: Configure the Azure OpenAI connection
-
In Studio, open your project and click the Project endpoints and connectors tab in the design component palette.
-
Click the Azure OpenAI connector to open the connection configuration.
-
Connection Name: Enter a name that identifies this connection, for example
Azure OpenAI. -
Endpoint: Enter the endpoint URL for your Azure OpenAI resource. You can find this in the Azure Portal under Resource Management > Keys and Endpoint in the left sidebar.
-
API/Secret Key: Enter the API key for your Azure OpenAI resource. You can find this in the Azure Portal at the same location: use the value from either the KEY 1 or KEY 2 field.
Tip
Store the API key as a project variable with its value hidden, then reference the variable here using the variable icon or by typing
[to select it. This keeps the key out of the connection configuration directly and makes it easy to rotate without editing the project. -
Optional settings: Click to expand. Two settings are relevant for common use cases:
- Store chat context across operations: (Cloud agent groups only.) Enables the connector to maintain conversation history between operations in the same environment that share the same
chatId. Use this when later operations need to reference earlier turns in a conversation. - Add a data source: Connects an Azure AI Search or Azure Cosmos DB for MongoDB (vCore) instance so that Azure OpenAI responses are grounded in your own data.
- Store chat context across operations: (Cloud agent groups only.) Enables the connector to maintain conversation history between operations in the same environment that share the same
-
Click Test to verify the connection, then click Save Changes.
Part 2: Configure the Prompt activity
The Prompt activity is a target: it consumes data mapped from a transformation and submits it to Azure OpenAI.
-
On the design component palette, expand the Azure OpenAI endpoint you created. Drag the Prompt activity type onto the design canvas to create an activity instance.
-
Double-click the activity to open its configuration.
Step 1: Enter a name and specify settings
-
Name: Enter a name for the activity, for example
Analyze Sentiment. -
Prompt text: Enter the base prompt text. If the prompt needs to incorporate source data fields dynamically (for example, including the text of a customer review or a support case description), enter the static instruction here and construct the full prompt in the transformation (see Part 3).
Example static prompt:
Analyze the sentiment of the following customer review: -
Model ID: Select the Azure OpenAI model to use. The list shows only models deployed in your Azure OpenAI resource. Click Refresh to update the list if you have deployed new models since opening this configuration. For information on deploying models, see Microsoft's documentation.
-
Optional settings: Click to expand:
- Role: Controls the type of prompt sent to Azure OpenAI. The default is System, which is appropriate for automated, non-interactive prompts. Use User to simulate a direct user prompt. For guidance on the Assistant and Tool roles, see Azure OpenAI Prompt activity.
- Temperature: Controls response randomness. Values closer to
0produce more deterministic output; values closer to2produce more varied output. It is not recommended to use this setting together with Top Probability. - Max Tokens: Limits the length of the response. The default is
16. Set this to avoid unexpectedly long completions. - Top Probability: An alternative to Temperature for controlling output diversity. It is not recommended to use this setting together with Temperature.
-
Click Next.
Step 2: Review the data schemas
The request and response schemas are displayed. The request schema includes prompt, model, max_tokens, temperature, and top_p. The response schema includes choices (an array containing the generated text, index, and finish_reason), usage (token counts), and errors.
Click Finished to save the activity configuration.
Part 3: Map source data to the prompt in a transformation
In the transformation that precedes the Prompt activity, map the source fields to the Prompt activity's request schema.
The most important field to map is prompt. Use a script node to construct the full prompt string by combining the static instruction with field values from the source:
<trans>
"Analyze the sentiment of the following customer review:\n\n" +
Source.ReviewText
</trans>
Where Source.ReviewText is a field from the source activity's response schema (for example, a field returned by a database Query activity).
To override the model set in the activity configuration, map the model field to a literal string or a project variable:
<trans>
$azure_openai_model
</trans>
Tip
You do not need to map every request schema field. Fields left unmapped use the values configured in the Prompt activity itself. Map only the fields that need to vary based on source data.
Part 4: Access the AI response
The Prompt activity's response schema is available in any transformation within the same operation or in a downstream operation.
Chain a downstream operation
Configure the Prompt operation's On Success action to run a second operation that processes the AI response:
-
Open the Prompt operation's settings.
-
On the Actions tab, set the On Success action to Run Operation and select the downstream operation.
For more information on chaining operations, see Configure error handling in operations.
Read the generated text
The Azure OpenAI connector uses the Chat Completion API, which returns the AI-generated text in choices[0].message.content. In the downstream operation's transformation, map this field to the target:
<trans>
Source.choices[0].message.content
</trans>
For example, map choices[0].message.content to a database field to store the result, or to a Slack message text field to post the AI response to a channel (see Send a Slack notification from a Studio operation).
Note
The Azure OpenAI connector uses the Chat Completion API, which returns text in choices[0].message.content. The standard OpenAI connector also uses the Chat Completions API and returns text in the same field.
Check for errors
The response schema also includes an errors array. If Azure OpenAI returns an error (for example, due to an invalid model deployment name or an exceeded token limit), the error details appear in errors[0].message. To surface these in the operation log, add a script node to the transformation that calls RaiseError when errors is populated:
<trans>
if(Length(Source.errors) > 0,
RaiseError(Source.errors[0].message)
);
</trans>
Verify the integration
-
Deploy and run the Prompt operation manually.
-
In the operation logs, confirm that the Prompt activity completed successfully and that the downstream operation was triggered.
-
Inspect the downstream operation's log to verify that
choices[0].message.contentcontains a valid AI-generated response. -
If the Prompt activity fails with an authentication error, verify the endpoint URL and API key in the Azure OpenAI connection and confirm the key has not been rotated in the Azure Portal.
Tip
To schedule the operation to run automatically, see Schedule an operation to run automatically.
For more advanced AI patterns built on this foundation, see Process documents with AI and Route LLM responses to Studio operations using function calling.