Budibase/budibase · error · HTTPError

Teams integration is not configured for this agent

Error message

Teams integration is not configured for this agent

What it means

validateMSTeamsIntegration resolves an agent's Microsoft Teams deployment configuration. If the agent has no MSTeamsIntegration object at all, there is nothing to validate or deploy, so it throws HTTP 400 before touching appId/appPassword.

Source

Thrown at packages/server/src/sdk/workspace/ai/deployments/ms-teams.ts:41

const normalisePackageSegment = (value: string) =>
  value
    .trim()
    .toLowerCase()
    .replace(/[^a-z0-9]+/g, "") || "agent"

const normaliseDescription = (description?: string) =>
  description?.trim() || DEFAULT_DESCRIPTION

const getOrigin = (url: string) => new URL(url).origin

const getHostname = (url: string) => new URL(url).hostname

export const validateMSTeamsIntegration = (
  agent: Agent
): ResolvedMSTeamsIntegration => {
  const integration = agent.MSTeamsIntegration
  if (!integration) {
    throw new HTTPError(
      "Teams integration is not configured for this agent",
      400
    )
  }

  const appId = integration.appId?.trim()
  const appPassword = integration.appPassword?.trim()
  const tenantId = integration.tenantId?.trim()

  if (!appId || !appPassword || !tenantId) {
    throw new HTTPError(
      "Teams integration requires appId (client ID) and appPassword (client secret value)",
      400
    )
  }

  if (!isValidUUID(appId)) {
    throw new HTTPError("Teams integration appId must be a valid UUID", 400)

View on GitHub (pinned to a81a902e9a)

Solutions

  1. Add the MSTeamsIntegration object (appId, appPassword, tenantId) to the agent before deploying.
  2. Re-save/re-fetch the agent to confirm the integration field is present in the loaded document.
  3. Guard the deployment path: only call the Teams deployment for agents with a configured Teams integration.

Example fix

// before
await deployMSTeams(agent) // agent has no MSTeamsIntegration
// after
if (!agent.MSTeamsIntegration) {
  agent = await api.saveAgent({ ...agent, MSTeamsIntegration: { appId, appPassword, tenantId } })
}
await deployMSTeams(agent)
Defensive patterns

Strategy: type-guard

Validate before calling

if (!agent.MSTeamsIntegration) {
  throw new Error("Agent must have MSTeamsIntegration configured before Teams deployment")
}

Type guard

function hasTeamsIntegration(a: Agent): a is Agent & { MSTeamsIntegration: ResolvedMSTeamsIntegration } {
  return Boolean(a.MSTeamsIntegration)
}

Try / catch

try {
  const integration = validateMSTeamsIntegration(agent)
} catch (e) {
  if (e.status === 400 && e.message.includes("not configured")) {
    // route user to Teams integration setup instead of deploying
    return { configured: false }
  }
  throw e
}

Prevention

When it happens

Trigger: Deploying or invoking an MS Teams agent (integration flow that calls validateMSTeamsIntegration) where agent.MSTeamsIntegration is undefined — the agent was created without Teams config, or the integration object was removed/not synced when the agent was loaded.

Common situations: Agent saved via API/script omitting the MSTeamsIntegration field; attempting a Teams deployment on an agent configured only for other channels; partial agent fetch dropping the integration field.

Related errors


AI-assisted analysis of Budibase/budibase@a81a902e9a (2026-08-29). Data as JSON: /api/errors/0b82591435622012. Report an issue: GitHub.