Configure Customer Service Omnichannel live chat


In this exercise, you'll be configuring live chat for Dynamics 365 Omnichannel for Customer Service. 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.

In the following tasks, you'll complete these steps:

  1. Assign Omnichannel agent security role.

  2. Create an application user using the MCH Application Id and your Bot ID.

  3. Configure queues for bot and agent users.

  4. Configure a context variable and routing rule to route the message either to a bot or agent.

Task 1: Assign Omnichannel agent security role

  1. While in the In-Private or Incognito window, navigate to Power Apps.

  2. Select your environment from the upper right Environment drop-down.

    Screenshot of the Environment page navigation bar.

  3. Select the gear icon in the upper right corner and navigate to Advanced Settings.

    Screenshot of the Environment Settings menu with Advance Settings selected.

  4. A new window should open and navigate to Dynamics 365. If loading takes a while, reload the page. It will navigate to the Business Management section of Dynamics 365.

    Screenshot of the Dynamics 365 Business Management section.

  5. On the top command bar next to Dynamics 365, select Settings to open the drop-down, then select Security in the third column under System.

    Screenshot of the Business Management Settings page with the Security option highlighted in the System menu.

  6. Under Security, select Users.

    Screenshot of the System Security Users option.

  7. Switch the view drop-down from Omnichannel Users to Enabled Users for the grid view so that your user will show in the list.

    Screenshot of the Omnichannel Users menu with Enabled Users option highlighted.

  8. While in the Enabled User list, scroll to find your user or use the Search bar.

  9. Select your user for the training and select Manage Roles on the top command bar.

    Screenshot of te Dynamics 365 Settings Manage Roles menu with the Omnichannel agent Role name selected.

  10. Select the Omnichannel agent roles to assign to your user and select OK.

    Screenshot of Manage User Roes with the Omnichannel agent Role Name selected.

Congratulations! You assigned the proper omnichannel agent role to your user to allow you to be a live agent in omnichannel.

Task 2: Create Health Bot user in Dynamics 365 Customer Service

We need two users to configure in Omnichannel for Dynamics 365 Customer Service:

  • Health Bot User - This is the Azure Health Bot user we created in the previous exercise.

  • Omnichannel Agent User - This is your current user that you're logged into Dynamics 365 with. This will allow you to be a live agent in Customer Service who receives messages from portal users through Azure Bot escalations.

In this task, you'll create a Bot User which helps connect Azure Health Bot with Omnichannel live Chat.

  1. Go to

  2. Select your Microsoft Cloud for Healthcare environment from the list.

    Screenshot of the list of environments.

  3. You'll land on your environments detail page.

    Screenshot of the admin center.

  4. Select the Settings button on the top command bar.

    Screenshot of the User dropdown menu with the Application User option selected.

  5. Expand Users + permissions and select Application users.

    Screenshot of the settings button.

  6. Select (+) New app user button to create a new Application User.

    Screenshot of new application users.

  7. Select (+) Add an app on the create screen that slides out on the right side.

    Screenshot of add an app for business unit.

  8. Paste the Application ID (the Application (client) ID you obtained in the Azure portal for the supplied MCH Application ID) into the search box and select the app from the list. Select Add at the bottom right.

    Screenshot of the application ID settings.

  9. Select a Business unit from the drop-down list (the options in the list will be unique for each Dynamics 365 environment). Select Create at the bottom right.

  10. Return to the Dynamics 365 User page, switch the view to Enabled Users.

    Screenshot of enabled Omnichannel users.

  11. While in the Enabled User list, scroll to find your App user or use the Search bar. Double select on the user or select the row and select Edit.

    Screenshot of the application ID search results.

  12. Change the form type from User to Application User above the User Name.

    Screenshot of the application user selection.

  13. You'll see a new form appears that aligns to an Application User.

    Screenshot of the application user selection new form.

  14. In the User Information section, enter or select the following information and select the Save icon in the bottom right corner:

    • User type - Select Bot application user. This will display a new field to store the Bot application ID.
    • Bot application ID - This is the Azure Health BotId you copied when enabling the Teams channel. This field is displayed once the User Type is selected to be Bot application user.

    Screenshot of the ID for the bot application.

  15. Select Manage Roles on the command bar.

    Screenshot of the manage roles form.

  16. Assign the Omnichannel Agent role to the Bot User as you did for your own user in the previous task. This will allow the bot to act as an omnichannel agent like your user.

    Screenshot of adding the role to users.

Congratulations! You successfully created a Bot User and assigned the Omnichannel Agent role to it.

Task 3: Create and configure Human Agent queues

Queues are used to collect and distribute workload among agents. Agents are added as members to the queues and the workload is distributed among the agents based on assignment methods. For more information, see Manage queues for unified routing.

In this task, you'll create the omnichannel queue necessary to communicate with a human agent.

  1. In Power Apps, open the Omnichannel admin center app.

    Screenshot of the Apps menu with the Omnichannel Administration option selected.

  2. You should be on the Homepage. Select Create a queue from the center shortcut.

    Screenshot of the Queues and Users menu with the Queues option selected.

  3. You'll now create a queue called Escalate to Human which will manage and redirect the incoming messages from a user to a Customer Service (human) Agent when Bot sends the user through to a live agent. Create the new Queue with the following details:

    • Name - Escalate to Human
    • Type - Messaging
    • Group number - [any number]
    • Select Create.

    Screenshot of the create a queue form.

  4. The new Queue record will open and contain a User subgrid. Select Add users in the subgrid.

    Screenshot of the default messaging queue Summary tab.

  5. Search for your user and add it to the queue.

    Screenshot of Lookup Records with MCH in the search feature and MCH user results returned.

  6. The user is now added to the queue with the agent role.

    Screenshot of Lookup Records with MCH Application record and the Add button.

  7. Select Queues on the left navigation bar and you'll now see it listed in the queues subgrid.

    Screenshot of the queue with the new role.

Congratulations! You created the necessary queue to escalate to human agent and added your user to the messaging queue.  Now we can create the workstream to initially route to a virtual bot along with routing rules to direct the user to Escalate to Human queue in the proper conditions.

Task 4: Update live work stream with context variables and routing rules

Workstreams are containers to enrich, route, and assign work items. A workstream is associated with a channel, such as live chat, voice, or case. After a bot is added to a workstream, the incoming work item is first routed to the selected bot at runtime based off classification rules. For more information, see Create workstreams for unified routing.

In this task, we'll set up basic chat routing with a new workstream. This will allow for users to chat with a bot user initially and route to a live human agent in the proper situation. We'll complete the following:

  • Create a new workstream
  • Set up a live chat channel
  • Add bot for initial routing: Initial customer conversation is directed to the Azure Health Bot.
  • Create context variable and routing rule to escalate to human agent: When context variable EscalateToAgent is present and set to 1, we route to the Escalate to Human queue we previously set up with our user as an agent who can take over the conversation.
  1. Navigate to WorkStreams.

    Screenshot of the Work Distribution Management menu with the Work Streams option selected.

  2. Select + New Workstream on the command bar.

    Screenshot new workstream from All workstreams view.

  3. Enter the following details for the new workstream:

    • Name - Chat Workstream
    • Type - Messaging
    • Channel - Chat
    • Work distribution mode - Push
    • Select Create

    Screenshot of the create a workstream form.

  4. On the Chat Workstream record, you must set up your chat channel. Select Set up chat under Live chat.

    Screenshot of set up chat details button.

  5. Live Chat setup screen will open. Enter the channel details as follows:

    • Name - Chat Widget
    • Language - English – United States
    • Select Next.

    Screenshot of the live chat setup details.

  6. On the following screen, toggle to enable Proactive chat. Here you may define any other settings for the chat widget.

    Screenshot of the proactive chat enabling.

  7. Select Next to see the Behavior settings you can customize for your bot, including automated messages and surveys. No need to customize anything here now.

    Screenshot of the Live chat workstream Routing Rules tab.

  8. Select Next to see the User features that can be defined for the bot. Nothing is needed here now.

    Screenshot of user features information page.

  9. Review your settings and select Create channel.

    Screenshot of the settings for the new channel.

  10. Once the chat channel is successfully created, copy the script of the chat widget, and save it somewhere to add it to your website later. Select Done to close the wizard.

    Screenshot of the copy script for channel created.

  11. In your new Chat Workstream record, select Add Bot to add the Azure Health bot for initial routing.

    Screenshot of adding the workstream bot.

  12. Find and select your bot. Select Add.

    Screenshot of the adding of a new bot.

  13. This should open the advanced settings and display your bot in the smart assist bots subgrid.

    Screenshot of the advanced settings for smart assist bots.

  14. You can also access the advanced settings at the bottom of the record page by selecting Show advanced settings.

  15. Now we want to define a new context variable and routing rule. Select + Add Context variable.

    Screenshot of adding a context variable.

  16. In the context variable flyout, select + Add to add new context variable.

    Screenshot of the adding the context variable.

  17. Create the new Context Variable with the following details:

    • Name - EscalateToAgent
    • Type - Number
    • Select **Create **

    Screenshot of adding context variable details.

  18. Close the context variable panel.

  19. You should now see the new EscalateToAgent context variable in the live chat workstream.

    Screenshot of context variable details in live chat.

  20. Select Advanced Settings to collapse to the main page.

  21. Under Route to queues, select +Create ruleset.

    Screenshot of the route to queues selection.

  22. Create the new route-to-queues ruleset with the following details:

    • Name - Human Agent
    • Description - Escalate to human agent
    • No Conditions.

    Screenshot of route to new queue settings.

  23. In the new Human Agent queue ruleset, select + Create rule.

  24. Name the new rule Human Agent Rule.

  25. Under conditions, choose Add related entity from the dropdown.

    Screenshot of adding related condition.

  26. In the first two drop downs, Choose Context item value and Contains data. In the inline condition, choose EscalateToAgent Equals 1.

    Screenshot of adding condition for bot.

  27. In the Route to queues section, choose Escalate to Human queue created previously.

  28. The configured rule set is shown below. Select Create.

    Screenshot of the the new routing rules.

  29. The Chat Workstream now has a Human Agent ruleset that will escalate to a human agent when the EscalateToAgent context variable is set to 1

    Screenshot of the the new routing for the workstream.

Congratulations! You've created a new Workstream with the proper live chat channel, smart assist bot, and routing rule that will allow customers to begin conversation with a health bot and escalate to a human agent.