Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 49 additions & 1 deletion docs/change-database/webhook.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,55 @@ The following events support sending direct messages/notifications to related us

### Microsoft Teams

[Official guide](https://docs.microsoft.com/en-us/microsoftteams/platform/webhooks-and-connectors/how-to/add-incoming-webhook)
[Official guide](https://support.microsoft.com/en-us/office/create-incoming-webhooks-with-workflows-for-microsoft-teams-8ae491c7-0394-4861-ba59-055e33f75498)

<Info>

Microsoft has [retired Office 365 Connectors](https://devblogs.microsoft.com/microsoft365dev/retirement-of-office-365-connectors-within-microsoft-teams/) in Teams. Use **Power Automate Workflows** to create incoming webhooks instead.

</Info>

1. In Microsoft Teams, select **More options (⋯)** next to the channel you want to post to, then select **Workflows**.
1. Choose **Post to a channel when a webhook request is received**.
1. Authenticate with your account and select the Team and Channel, then click **Add workflow**.
1. Copy the generated webhook URL (it looks like `https://xxx.environment.api.powerplatform.com:443/powerautomate/automations/direct/workflows/...`).
1. Go to Bytebase **Integration > Webhooks** in a project, paste the URL and create the webhook.

#### Configure sending direct messages to related users

##### Option 1: Chat Webhook via Power Automate

You can use the **Post to a chat when a webhook request is received** workflow template to send alerts to a chat via the Flow bot.

<Note>

This template may not be available depending on your organization type, tenant configuration, or admin policies. Contact your IT admin if you don't see it. For a universally available approach, use Option 2.

</Note>

1. In Microsoft Teams, select **More options (⋯)** next to a chat, then select **Workflows**.
1. Choose **Post to a chat when a webhook request is received**. If the template is not listed, you can build the flow manually in [Power Automate](https://make.powerautomate.com/) using the **When a Teams webhook request is received** trigger and the **Post card in a chat or channel** action.
1. Authenticate with your account and select the chat, then click **Add workflow**.
1. Copy the generated webhook URL.
1. Go to Bytebase **Integration > Webhooks** in a project, paste the URL and create the webhook.

##### Option 2: Azure AD Bot Framework (recommended)

Register an Azure AD application with Bot Framework capabilities. This allows Bytebase to send 1:1 direct messages to any user matched by email without per-user workflow setup.

1. Go to [Azure Portal](https://portal.azure.com/) and navigate to **Microsoft Entra ID > App registrations**.
1. Click **New registration**, give it a name (e.g., "Bytebase Bot"), and register.
1. Note the **Application (client) ID** and **Directory (tenant) ID**.
1. Go to **Certificates & secrets**, click **New client secret**, and copy the **Secret value**.
1. Go to [Bot Framework Registration](https://dev.botframework.com/bots/new) or use the **Azure Bot** resource in Azure Portal to register a bot using the same Application ID.
1. In the bot's **Channels** settings, enable the **Microsoft Teams** channel.
1. Grant the following **Microsoft Graph API application permissions** to the app:
- `User.Read.All` — to look up users by email
- `TeamsAppInstallation.ReadWriteForUser.All` — to install the app for users
- `Chat.Create` and `Chat.ReadWrite.All` — to get chat IDs for direct messaging
1. Click **Grant admin consent** for the permissions.
1. Go back to Bytebase and fill **Tenant ID**, **Client ID**, and **Client Secret** fields under **Integration > IM**.
1. Go to **Integration > Webhooks** in a project, add a webhook, check the events you want to send direct messages for, enable **Direct Messages**, and click **Create**.

### DingTalk

Expand Down