
Prerequisites
- Access to the Azure Bot Service platform.
- An account on the Microsoft Entra Admin Center.
- An account on the Microsoft Teams Developer Portal.
Restrictions
- In Microsoft Teams, postback buttons in quick reply, gallery, list, or button configurations will always display the button title in the user’s chat when clicked. This behavior can’t be disabled but doesn’t affect other channels supported by the Azure Bot Service endpoint.
Generic endpoint settings
Learn about the generic endpoint settings on the following pages:- Endpoints overview
- NLU connectors
- Data protection & analytics
- Transformer functions
- Real-time translation
- Inject and Notify
- Copilot
Endpoint-specific settings
Behavior tab
Session management
Advanced tab
Azure Bot services connection
How to set up
Configure in Cognigy
Create Azure Bot Service endpoint
Create Azure Bot Service endpoint
- In the left-side menu of your project, click Deploy > Endpoints.
- On the Endpoints page, click + New Endpoint.
- In the New Endpoint dialog, select the Azure Bot Service endpoint type and click Create endpoint.
- On the Setup tab, configure the following: Endpoint name — enter a unique name. Target type — select an agent or flow from the list. Save changes.
- In the Integration section, copy the endpoint URL and save it for later use in Azure Bot Service.
Set up multiple SSO connections (Optional)
Set up multiple SSO connections (Optional)
The Azure Bot Service endpoint supports holding Microsoft SSO tokens for multiple OAuth connections simultaneously within a single conversation. Multiple OAuth connections allow your flow to authenticate users with different Azure Bot OAuth connections, for example, Microsoft Graph and a custom API, in a single session.To target a different connection’s token, use the Overwrite Connection toggle in the Get Token, Invalidate Token, and Token Status nodes. Activating this toggle creates additional keys in The
input.data.microsoftSsoConnections, in addition to the connection configured in the endpoint settings.Each connection’s data is accessible from the flow under input.data.microsoftSsoConnections, keyed by connection name:audience field holds the token’s decoded aud claim. This claim identifies the API or resource that the token is valid for. The field is informational and may be null for opaque tokens, such as Microsoft Graph tokens.Configure in Azure Bot Service
1. Create app in Azure AD B2C
1. Create app in Azure AD B2C
- Go to the Microsoft Entra Admin Center and select Azure AD B2C.
- In the Manage section, select App registrations, then click New registration.
-
In the Supported account types section, select one of the following options:
- Single tenant
- Multitenant
- Under Redirect URI, pick Single-page application (SPA) and enter the URL
https://login.microsoftonline.com/<tenantID>/oauth2/v2.0/token. - Click Register, then copy Tenant ID.
- Go to Entra ID > App registrations, find your application that you created. Then copy and save the Application (client) ID.
- Open the app by clicking on its name. Go to Manage > Authentication. Enter the Cognigy endpoint URL in the Front-channel logout URL field. In the Supported account types section, ensure that Accounts in this organizational directory only for a single tenant is enabled.
- Go to Manage > Certificates & secrets. Click + New client secret. Name your secret, set expiry, click Save. Copy the value and save it for later use.
-
Go to Manage > API permissions, click + Add a permission, then Microsoft Graph > Delegated permissions. Select
openid, which is required for SSO. Select other permissions likeemailif needed. - Click Add permissions. Click Grant admin consent if required — permissions get a green check.
-
Go to Manage > Expose an API. In the Application ID URI field, enter
api://botid-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx. Replacexwith your saved Client ID. Save changes. - Click + Add a scope. Name the scope. Allow both admins and users to consent. Fill in other required fields. Save changes.
-
Click + Add a client application and add:
5e3ce6c0-2b1f-4285-8d4b-75ee78787346(MS Teams Web)1fec8e78-bce4-4aaf-ab1b-5451cc387264(MS Teams Mobile & Desktop)
-
Go to Manage > Manifest, update the following parameters to the values:
AccessTokenAcceptedVersionto2.Oauth2RequirePostResponsetotrue(use only for Single Tenant).SignInUrl– enter your Cognigy endpoint URL. Save changes.
2. Create resource group in Azure Bot Service
2. Create resource group in Azure Bot Service
If you already have a resource group, you can skip this section.
- Click the Create a resource card. In the Marketplace search, enter resource group.
- In the search results, find the Resource group card. At the bottom of this card, click Create > Resource group.
- On the Create a Resource group page, select your subscription from the list. A trial or usage-based one will work.
- Specify a unique name for the group.
- Select a region to store the resources.
- Save changes by clicking Review + create, then Create.
3. Create bot in Azure Bot Service
3. Create bot in Azure Bot Service
- Click the Create a resource card.
- In the Marketplace search, enter azure bot. In the search results, find the Azure bot card. At the bottom of this card, click Create > Azure bot.
-
On the Create an Azure bot page, fill in the following fields:
- Bot handle - enter a display name for the Azure bot.
- Subscription and Resource group - select the same values that you previously configured in the Resource group section.
- Data residency — select Global.
- Pricing tier — select Free plan by clicking Change plan.
-
In the Microsoft App ID section, fill in the following fields according to the scope of your app:
- Single tenant
- Multitenant
- Select Single Tenant.
- In the Creation type list, select Use an existing app registration.
- In the App ID field, enter the Client ID you previously copied and saved.
- In the App tenant ID field, enter the Client Secret you previously copied and saved.
- Save changes by clicking Review + create, then Create. Wait for the deployment, which might take 1-2 minutes, then go to the resource.
- In the Settings section, select Configuration.
- The Messaging endpoint field must contain the previously copied endpoint URL from the Azure Bot Service endpoint. Activate Enable Streaming Endpoint. Click Add OAuth Connection Settings.
-
On the New Connection Setting window, fill in the following fields:
- Name — add a unique name. Copy and save this name for later use in Cognigy.
- Service provider — select Azure Active Directory v2.
- Client ID — enter the Client ID you previously copied and saved.
- Client Secret — enter the Client Secret you previously copied and saved.
- Token Exchange URL — enter the Cognigy endpoint URL.
- Tenant ID — enter the word
commonfor a multitenant or the tenant ID for a single tenant. - Scopes — add the permissions your bot should have. Must be in a space-delimited list. For example,
email offline_access openid profile User.Read.
- Save changes. At the bottom of the Configuration page, click Apply.
4. Add Teams channel to your Azure bot
4. Add Teams channel to your Azure bot
- Add the Teams channel to your channel list.
- Go to the Azure Bot that you have just configured.
- In the Settings section, select Channels.
- In the Available channels section, select Microsoft Teams.
- Accept Terms of Service by clicking Agree. Click Save. The Teams channel appears in your channel list.
The Teams channel might display errors. You can ignore these errors because each message is properly delivered to and processed by Cognigy.
5. Update Azure Bot Service endpoint
5. Update Azure Bot Service endpoint
To update the Azure Bot Service endpoint:
- In the Cognigy interface, go to Deploy > Endpoints. Select the Azure Bot Service endpoint you previously created.
- On the Advanced tab, in the Azure Bot Services Connection section, fill in the fields as follows:
- Microsoft App ID — enter the Client ID.
- Microsoft App Password — enter the Client Secret.
- SSO Connection Name — enter the Connection Name.
6. Create Microsoft Teams app
6. Create Microsoft Teams app
- Go to the Microsoft Teams Developer Portal and select Apps from the left pane.
- Select + New app, enter your app name and click Add. Go to Configure > Basic Information.
- Fill in the following fields:
- Short description — a brief summary about your app.
- Long description — more details about your app, such as its functions or restrictions.
- Developer or Company name — for example,
Cognigy. - Website — for example, https://www.cognigy.com/.
- Privacy policy — for example, https://www.cognigy.com/privacy-policy.
- Terms of use — for example, https://www.cognigy.com/legal-notice.
- Application (client) ID — the Client ID you saved earlier.
- (Optional) Microsoft Partner Network ID — only if you have admin consent permissions.
- Save changes and specify which features your bot will use:
- Go to Configure > App features.
- Select the Bot card.
- On the Bot page, configure the following settings: 3.1 Select Enter a bot ID and enter your saved Client ID. 3.2 Enable Upload and download files — required to prevent a bug that blocks attachments. 3.3 Select Personal scope.
- Save changes.
(Optional) 6.1 Configure single sign-on
(Optional) 6.1 Configure single sign-on
If you want to use Single Sign-On (SSO) with your bot, follow these steps:
- Go to Configure > Single sign-on.
- In the Application ID URI field, enter
api://botid-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx. Replacexwith your saved Client ID. Save changes. - Still under Single sign-on, add these domains:
token.botframework.com— for token authentication.mydomain.com— your endpoint’s hosting domain.
- To complete the SSO configuration, go to the Cognigy Help Center: SSO and Graph API nodes guide.
7. Configure app package
7. Configure app package
- Go to Configure > App package.
- At the top, click Download App package.
- Unzip the downloaded package, you’ll get two images and a
manifest.jsonfile. Open themanifest.jsonin a code editor. Make these adjustments:- Around line 6, replace
packageNamewith your unique package name — do not usecom.package.name. Otherwise, SSO won’t work. - Add this key at the top level:
- Around line 6, replace
- Save the changes and zip the modified
manifest.jsonfile and the two images. The new zip file must contain only these files. - Open your Teams client or go to https://teams.microsoft.com.
- In the bottom-left corner, click Apps.
- Click Upload a custom app and select your new
.zippackage. Click Add — the bot should now appear as a contact you can chat with.
Access connection data from flows
To access OAuth token connections from your flows, make sure you do the following:- Add one Get Token node per OAuth connection to your flow. Each connection requires its own consent process.
- Each connection must be registered in Azure Bot Service under Configuration > OAuth Connection Settings.
microsoft-graph connection and a contoso-crm connection in Azure Bot Service:
- Code node
- Text field