Azure OpenAI
Generate text and embeddings using OpenAI models hosted on Microsoft Azure.
Connect
Auth type: Credentials form (custom_auth). Pass the fields the provider needs (listed below) as the connection's credentials. They are sealed at rest.
| 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 |
- From your agent: integrations {action: "connect", piece, credentials, env} stores the credentials for dev, prod or all. Answers name the fields, never the values.
- Or set the integration's project secrets with the secrets tool (SLACK_BOT_TOKEN, DISCORD_WEBHOOK_URL, TELEGRAM_BOT_TOKEN, TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN …): a call uses the connection, else those secrets. integrations {action: "catalog", piece} lists which ones work.
- Try one action now with integrations {action: "call", piece, piece_action, input}. It really sends.
Call it from a workflow
step.ctx.integrations.invoke("azure_openai", action, input) resolves with the provider's answer and rejects when Azure OpenAI isn't connected or refuses. Wrap it in step.run so a retry sends once. See step.ctx. Its actions run through the integration runner, which the server's operator turns on: integrations {action: "catalog", piece: "azure_openai"} says whether yours can call it.
// workflows/notify.ts: call Azure OpenAI when a booking is confirmed
import { on } from "@appbricx/workflows";
export const tellAzureOpenai = on.transition("booking", "status", "confirmed", async (_event, step) => {
// Recorded once: a retry doesn't send it twice. Rejects when Azure OpenAI isn't connected.
const output = await step.run("Azure OpenAI", () =>
step.ctx.integrations.invoke("azure_openai", "ask_gpt", {
"deploymentId": "<deployment name>",
"prompt": "<question>",
"maxTokens": 1
}),
);
step.ctx.log("Azure OpenAI answered", output);
});{
"name": "integrations",
"arguments": {
"project_id": "<project-id>",
"action": "call",
"piece": "azure_openai",
"piece_action": "ask_gpt",
"input": {
"deploymentId": "<deployment name>",
"prompt": "<question>",
"maxTokens": 1
},
"env": "dev"
}
}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_gpt
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- Runs
- Through the integration runner