Azure OpenAI
Generate text and embeddings using OpenAI models hosted on Microsoft Azure.
Connect
Auth type: Credentials form (custom_auth). Fill in the fields the provider needs (listed below). They are stored encrypted in the vault.
| Field | Type | Description |
|---|---|---|
endpointrequired | text | Your Azure OpenAI resource endpoint URL |
apiKeyrequired | secret | Your Azure OpenAI API key |
deploymentNamerequired | text | The name of your model deployment |
- In the editor: Backend panel, Integrations tab, then Connect. This connects it for the project.
- For every project in a workspace: Workspace settings, Integrations.
- Owners and admins choose which integrations members may connect in the admin panel (Integrations tab), and can attach their own OAuth app there.
Call it from a workflow
Pass the action name and its input. The call resolves with { success, output, error? }; a missing connection resolves with success false and the reason. See ctx.integrations.invoke and ctx.integrations.call.
// .workflow.js (native ctx)
export async function run(ctx) {
const res = await ctx.integrations.invoke("azure_openai", "ask_gpt", {
"deploymentId": "<deployment name>",
"prompt": "<question>",
"maxTokens": 1
});
if (!res.success) throw new Error(res.error);
ctx.log.info("Azure OpenAI answered", { output: res.output });
}// defineWorkflow module (@app/sdk ctx)
import { defineWorkflow } from "@app/sdk";
export default defineWorkflow({
id: "azure-openai-ask-gpt",
name: "Azure OpenAI: Ask GPT",
description: "Calls Azure OpenAI when a row is created.",
trigger: { type: "entity_event", entity: "tickets", event: "created" },
async run(ctx, event) {
const res = await ctx.integrations.call("azure_openai", {
"action": "ask_gpt",
"deploymentId": "<deployment name>",
"prompt": "<question>",
"maxTokens": 1
}) as { success: boolean; error?: string };
if (!res.success) throw new Error(res.error);
},
});curl -X POST "$APP_ORIGIN/__appbricx/connector-proxy/azure_openai/ask_gpt" \
-H "Authorization: Bearer $APP_KEY" \
-H "content-type: application/json" \
-d '{"props":{"deploymentId":"<deployment name>","prompt":"<question>","maxTokens":1}}'Actions
ask_gptin catalog
Ask GPT. Ask ChatGPT anything you want!
| Input | Type | Description |
|---|---|---|
deploymentIdrequired | text | The name of your model deployment. |
promptrequired | long text | Question |
temperatureoptional | number | Controls randomness: Lowering results in less random completions. As the temperature approaches zero, the model will become deterministic and repetitive. |
maxTokensrequired | number | The maximum number of tokens to generate. Requests can use up to 2,048 or 4,096 tokens shared between prompt and completion depending on the model. Don't set the value to maximum and leave some token… |
topPoptional | number | An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top … |
frequencyPenaltyoptional | number | Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim. |
presencePenaltyoptional | number | Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the mode's likelihood to talk about new topics. |
memoryKeyoptional | text | A memory key that will keep the chat history shared across runs and flows. Keep it empty to leave ChatGPT without memory of previous messages. |
rolesoptional | JSON | Array of roles to specify more accurate response |
Details
- Id
azure_openai- Category
- AI and ML
- Tags
- ai, azure, openai, llm, enterprise, microsoft
- Package
@activepieces/piece-azure-openai@0.1.4- Tier
- Built in