{"record":{"id":"86ab2558d11a6c17","repo":"Budibase/budibase","slug":"teams-integration-appid-must-be-a-valid-uuid","errorCode":null,"errorMessage":"Teams integration appId must be a valid UUID","messagePattern":"Teams integration appId must be a valid UUID","errorType":"http","errorClass":"HTTPError","httpStatus":400,"severity":"error","filePath":"packages/server/src/sdk/workspace/ai/deployments/ms-teams.ts","lineNumber":59,"sourceCode":"    throw new HTTPError(\n      \"Teams integration is not configured for this agent\",\n      400\n    )\n  }\n\n  const appId = integration.appId?.trim()\n  const appPassword = integration.appPassword?.trim()\n  const tenantId = integration.tenantId?.trim()\n\n  if (!appId || !appPassword || !tenantId) {\n    throw new HTTPError(\n      \"Teams integration requires appId (client ID) and appPassword (client secret value)\",\n      400\n    )\n  }\n\n  if (!isValidUUID(appId)) {\n    throw new HTTPError(\"Teams integration appId must be a valid UUID\", 400)\n  }\n\n  return {\n    appId,\n    appPassword,\n    tenantId,\n  }\n}\n\nexport const buildMSTeamsWebhookUrl = async (agentId: string) =>\n  await shared.buildProviderWebhookUrl(AgentChannelProvider.MSTEAMS, agentId)\n\nexport const buildMSTeamsManifest = ({\n  agent,\n  messagingEndpointUrl,\n  appPackageVersion,\n}: {\n  agent: Agent","sourceCodeStart":41,"sourceCodeEnd":77,"githubUrl":"https://github.com/Budibase/budibase/blob/a81a902e9a8fe55b467d106765f6638f12e35c49/packages/server/src/sdk/workspace/ai/deployments/ms-teams.ts#L41-L77","documentation":"This HTTP 400 error is thrown by validateMSTeamsIntegration in packages/server/src/sdk/workspace/ai/deployments/ms-teams.ts when the appId (Microsoft Teams app client ID) supplied for a Teams integration fails the isValidUUID check. Budibase requires Teams app IDs to be well-formed UUIDs because they correspond to Azure AD app registration client IDs. Any malformed ID is rejected before the integration is saved or deployed.","triggerScenarios":"Calling the MS Teams integration save/deploy path with agent.msTeamsIntegration.appId set to a non-UUID string (e.g. a bot name, a GUID without the hyphenated UUID format, an empty-looking placeholder, or a truncated copy-paste of the Azure app registration client ID).","commonSituations":"Developers copy the Azure AD app registration client ID with missing characters, paste the object ID instead of the application (client) ID, or hand-enter a Teams 'Microsoft App ID' that is not hyphen-formatted. Older bots or manually created manifests sometimes use non-UUID identifiers.","solutions":["Open the Azure Portal > App registrations, find your bot registration and copy the exact 'Application (client) ID' (a hyphenated UUID like 12345678-1234-1234-1234-123456789012).","Paste the full client ID including hyphens into the appId field of the agent's msTeamsIntegration and retry.","If the ID has no hyphens, format it as a standard 8-4-4-4-12 UUID before saving.","Verify you are not confusing the Azure 'Object ID' with the 'Application (client) ID'; only the latter is valid here."],"exampleFix":"// before\nagent.msTeamsIntegration = { appId: \"my-teams-bot\", appPassword: \"secret\" }\n// after\nagent.msTeamsIntegration = {\n  appId: \"8f2a1c34-56b7-4c89-9d01-2e3f4a5b6c7d\", // Azure App registration client ID\n  appPassword: \"secret\"\n}","handlingStrategy":"validation","validationCode":"const UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i\nif (!UUID_RE.test(msTeams.appId)) {\n  throw new Error(\"appId must be the Azure AD Application (client) ID in UUID format\")\n}","typeGuard":"const isUuid = (v: string | undefined): v is string =>\n  typeof v === \"string\" && /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(v)","tryCatchPattern":"try {\n  await saveTeamsIntegration({ appId, appPassword })\n} catch (e) {\n  if (e instanceof HTTPError && e.message.includes(\"valid UUID\")) {\n    // surface: re-prompt user for the Azure Application (client) ID\n  }\n  throw e\n}","preventionTips":["Always copy the Application (client) ID from the Azure Portal, never the Object ID.","Validate UUID format client-side before submitting the integration form.","Store Teams credentials in env vars or a secret manager rather than typing them by hand."],"tags":["validation","azure","ms-teams","uuid"],"backgroundTag":"invalid-uuid-identifier","analyzedSha":"a81a902e9a8fe55b467d106765f6638f12e35c49","analyzedAt":"2026-08-29T01:03:10.972Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}