Azure OpenAI

Generate text and embeddings using OpenAI models hosted on Microsoft Azure.

AI and MLCredentials form1 actionAll integrations

On this page
  1. Connect
  2. Call it from a workflow
  3. Actions (1)
  4. ask_gpt
  5. Details

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.

FieldTypeDescription
endpointrequiredtextYour Azure OpenAI resource endpoint URL
apiKeyrequiredsecretYour Azure OpenAI API key
deploymentNamerequiredtextThe 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.

Workflow
// 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);
});
Try it from your agent
{
  "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"
  }
}
From another backend (connector proxy)
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!

InputTypeDescription
deploymentIdrequiredtextThe name of your model deployment.
promptrequiredlong textQuestion
temperatureoptionalnumberControls randomness: Lowering results in less random completions. As the temperature approaches zero, the model will become deterministic and repetitive.
maxTokensrequirednumberThe 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…
topPoptionalnumberAn 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 …
frequencyPenaltyoptionalnumberNumber 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.
presencePenaltyoptionalnumberNumber 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.
memoryKeyoptionaltextA memory key that will keep the chat history shared across runs and flows. Keep it empty to leave ChatGPT without memory of previous messages.
rolesoptionalJSONArray 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