Integrate an Azure bot
Applies to: Dynamics 365 Contact Center—embedded, Dynamics 365 Contact Center—standalone, and Dynamics 365 Customer Service
Important
Azure Active Directory is being renamed to Microsoft Entra ID. No action is needed from you. For more information, see New name for Azure Active Directory.
In Omnichannel for Customer Service, you can integrate Azure bots seamlessly with chat and social channels, and also repurpose Azure bots to be smart assist bots and provide recommendations to agents. For more information, see Manage smart assist and View smart assist suggestions. This article discusses how you can integrate Azure bots, configure routing rules, and set escalation rules.
Prerequisites
Have a bot that's built using the Microsoft Bot Framework and registered with Azure Bot Service. Ensure that you register the bot resource as a multitenant app.
To create an Azure bot resource, see Create Azure bot resource section in the Bot Framework SDK documentation. Be sure to note the values of the Microsoft App ID and the Bot Application ID.
Set the messaging endpoint in your bot configuration. More information: Configure bot settings
Register your app on the Azure portal. Make a note of the registered app name.
Note
If you're using multiple bots, make sure that you create unique applications and have unique application IDs for each bot.
- To use the bot over messaging channels, add Omnichannel channel as a supported channel.
Integrate Azure bots with Omnichannel for Customer Service
After you meet the prerequisites, perform the following steps to integrate your Azure bots with Omnichannel for Customer Service.
- Connect your Azure bot resource to Omnichannel channel.
- Configure the bot user as an omnichannel agent.
- Configure routing rules and context variables.
- Add the bot user to queues.
- Set escalation rules as required.
Connect your bot resource to Omnichannel channel
Perform the following steps to connect and register your bot with the Omnichannel channel.
Open the Azure portal, and then select your bot resource.
On the left pane, under Settings, select Channels and then select Omnichannel from the list of channels.
On the Configure Omnichannel page, select Apply.
Your bot is now registered with the Omnichannel channel.
Configure the bot user as an omnichannel agent
The bot user is first created as an application user and then assigned the Omnichannel agent role.
Open the PowerPlatform admin center.
Select the environment you want to configure, and then select Settings.
On the Settings page, select Users + permissions, and then select Application users.
On the Application users page, select New app user and in the Create a new app user dialog that opens, do the following:
a. Select a Business unit in the list. Make sure that you select the top-level business unit.
b. Edit the Security roles field, and in the Add security roles page, select Omnichannel agent from the dropdown list and select Save to go back to the Create a new app user dialog.
c. Select Add an app. The Add an app from Microsoft Entra Identity dialog opens.
d. Select the app that you created during your Azure app registration, and then select Add and Create.
Open your Power Platform environment and under Settings > System > Security > Users, search and open the newly created user.
Select the APPLICATION USER form.
In the User Information section, do the following:
- User type: Select Bot application user from the dropdown list.
- Bot application ID: Enter the Microsoft App ID from Microsoft Entra ID that you noted earlier from the Prerequisites section.
- Bot Application ID: Enter the bot application ID that you noted earlier from the Prerequisites section.
Select the save icon at the bottom of the page.
Add the bot user to queues
You can add a bot user to specific queues where you want the bot to handle the customer queries first, instead of the agent. For this option, you must ensure that the bot user has the highest capacity among all users in the queue.
Alternatively, you can also create a queue with the bot user only. In such a case, ensure that the routing rules are set in a way that customer queries are sent to this queue first. This action ensures that the bot acts as the first recipient for all queries.
An agent can transfer a chat to a bot by adding the bot to a queue, and then transferring the chat to the queue.
Note
- The chat cannot be transferred to the same bot.
- The bot works with the chat widget, workstream, and queues created in Omnichannel for Customer Service.
Configure routing rules
Routing rules route the incoming customer queries to their respective queues. Each routing rule has a condition and a destination queue. If the condition is evaluated as true, the customer query is routed to the destination queue. For bots, the condition is built by using context variables. To learn about context variables and how to add them, see Configure context variables for a bot.
Bots can be developed to receive customer queries first, gain information about the query, and then pass the query to a human agent if necessary. To achieve this behavior, you must first add the bot user to the queue and configure routing rules in a way that the incoming customer queries are routed to the queue with the bot user. Be sure to map the routing rules to the correct queues so that the queries are routed appropriately.
Set escalation rules
Escalation rules allow you to create rules for the bot to escalate the queries to the appropriate agent. For escalation rules, you must configure context variables and set routing rules to route the customer queries. If the bot escalates a customer query, it routes to the appropriate queue as per the defined routing rule. Even if the query is redirected to the same queue, another agent in the queue picks the conversation as per the capacity.
Privacy notice
You understand that your data may be transmitted and shared with external systems, and that your data may flow outside of your organization's compliance boundary (even if your organization is in a Government Cloud environment). For example, your messages are shared with the bot, which could be interacting with a third-party system based on the integration done by you. For more information on how we process your data, see the Microsoft Privacy Statement.
Related information
Overview of bots
Best practices for configuring Azure and Copilot Studio bots
Integrate Copilot Studio bot
Create workstreams for unified routing
Work with queues in Omnichannel for Customer Service
View bot insights
Configure Azure bots to escalate and end conversation
Configure context variables for bots
Manage context variables
Create an application user