Integrate an Azure bot

Omnichannel for Customer Service offers a suite of capabilities that extend the power of Dynamics 365 Customer Service Enterprise to enable organizations to instantly connect and engage with their customers across digital messaging channels. An additional license is required to access Omnichannel for Customer Service. For more information, see the Dynamics 365 Customer Service pricing overview and Dynamics 365 Customer Service pricing plan pages.

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.


Integrate Azure bots with Omnichannel for Customer Service

After you've checked for the prerequisites, perform the following steps to integrate your Azure bots with Omnichannel for Customer Service.

  1. Connect your Azure bot resource to Omnichannel channel.
  2. Configure the bot user as an omnichannel agent.
  3. Configure routing rules and context variables.
  4. Add the bot user to queues.
  5. 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.

  1. Open the Azure portal, and then select your bot resource.

  2. On the left pane, under Settings, select Channels and then select Omnichannel from the list of channels.

  3. 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.

  1. Open the PowerPlatform admin center.

  2. Select the environment you want to configure, and then select Settings.

  3. On the Settings page, select Users + permissions, and then select Application users.

  4. 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 from the dropdown list.

    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 Azure Active Directory dialog opens.

    d. Select the app that you created during your Azure app registration, and then select Add and Create.

  5. Open your Dynamics 365 environment and under Settings > System > Security > Users, search and open the newly created user.

  6. Select the APPLICATION USER form.

  7. 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 the Azure AD (Active Directory) that you noted earlier from the Prerequisites section.
    • Bot handle: Enter the bot handle that you noted earlier from the Prerequisites section.
  8. 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, 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 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.


  • 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 required. 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's routed 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 will pick 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 will be 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, please refer to the Microsoft Privacy Statement.

See also

Overview of bots
Sample configuration to integrate Azure bots
Best practices for configuring Azure and Power Virtual Agents bots
Create workstreams for unified routing
Work with queues in Omnichannel for Customer Service
View bot insights
Configure Azure bots to escalate and end conversation
Context variables for a bot
Create an application user