Budibase/budibase · error · HTTPError

Teams integration requires appId (client ID) and appPassword

Error message

Teams integration requires appId (client ID) and appPassword (client secret value)

What it means

After confirming MSTeamsIntegration exists, validateMSTeamsIntegration trims appId, appPassword, and tenantId and requires all three to be non-empty (note: tenantId is also enforced despite the message naming only appId/appPassword). Missing any of them aborts the Teams deployment with HTTP 400, since Azure Bot registration cannot proceed without full credentials.

Source

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

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)
  }

  return {
    appId,
    appPassword,
    tenantId,
  }
}

export const buildMSTeamsWebhookUrl = async (agentId: string) =>
  await shared.buildProviderWebhookUrl(AgentChannelProvider.MSTEAMS, agentId)

View on GitHub (pinned to a81a902e9a)

Solutions

  1. Fill in appId (Azure client ID), appPassword (client secret value), and tenantId on the agent's MSTeamsIntegration.
  2. Complete the Azure app/bot registration to obtain the missing client ID/secret values.
  3. Re-copy environment config including tenantId — it is mandatory even though the error message only mentions appId/appPassword.

Example fix

// before
MSTeamsIntegration: { appId: "", appPassword: secret, tenantId: "" }
// after
MSTeamsIntegration: { appId: "00000000-0000-0000-0000-000000000000", appPassword: secret, tenantId: "11111111-1111-1111-1111-111111111111" }
Defensive patterns

Strategy: validation

Validate before calling

const i = agent.MSTeamsIntegration
const missing = ["appId", "appPassword", "tenantId"].filter(k => !i?.[k]?.trim())
if (missing.length) throw new Error(`Teams integration missing: ${missing.join(", ")}`)

Type guard

function isCompleteTeamsIntegration(i?: { appId?: string; appPassword?: string; tenantId?: string }): i is { appId: string; appPassword: string; tenantId: string } {
  return Boolean(i?.appId?.trim() && i?.appPassword?.trim() && i?.tenantId?.trim())
}

Try / catch

try {
  validateMSTeamsIntegration(agent)
} catch (e) {
  if (e.status === 400 && e.message.includes("appId (client ID)")) {
    throw new Error("Complete Azure app registration fields (appId, appPassword, tenantId) in agent settings")
  }
  throw e
}

Prevention

When it happens

Trigger: Saving/deploying an agent whose MSTeamsIntegration has empty/whitespace-only appId, appPassword, or tenantId — e.g. the form submitted without completing the Azure app registration fields, or secrets left blank in the integration object.

Common situations: Configuring Teams integration before creating the Azure Bot/app registration; secrets stripped when copying agent config between environments; tenantId field overlooked (it is required too).

Related errors


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