apps/api/migrations/msteams-multi-tenant/README.md
This is an operational runbook, not a database migration. The multi-tenant MS Teams changes are backward compatible, so there is nothing to back-fill in MongoDB:
ChannelEndpoint.endpoint.tenantId (MS Teams user endpoints) is optional. Existing endpoints
without it keep working: notification delivery falls back to the linked admin-consent
connection's workspace.id (the home tenant), exactly as before.Integrations onboarded before this change created their Entra app registration with
signInAudience: 'AzureADMyOrg' (single tenant). New integrations are created with
signInAudience: 'AzureADMultipleOrgs' (multi tenant). Switching an existing app to multi-tenant
invalidates prior admin consent, so it cannot be flipped silently or in bulk from Novu's side — it
requires action in the owner's Azure tenant and re-consent in each consuming tenant.
There is intentionally no automated script that rewrites customer Azure app registrations.
Performed by the Novu user who owns the integration (the bot's home tenant admin):
signInAudience: AzureADMultipleOrgs). The Application (client) ID and Tenant ID
do not change. Re-running Novu Quick Setup for a fresh integration also produces a multi-tenant
app automatically.workspace.id, so no Novu data change is required).For each external customer:
https://login.microsoftonline.com/common/adminconsent?client_id=<APP_ID>.No data changes to roll back. Reverting the code restores single-tenant authorize/consent
behavior; endpoints that recorded a tenantId remain valid (the field is simply ignored by the
old delivery path, which falls back to the connection's workspace.id).