Use case
Currently, the organization is using email and SMS text messages to communicate with customers. As a result, process timing can be disrupted, the company loses valuable insights from data, and missed opportunities to serve their customers abound. They need a unified solution for housing customer service and sales conversations initiated by their mobile app.
Requirements
1. Mobile users cannot be maintained through our organizational Active Directory
2. Mobile users need to authenticate through a different provider, yet be under our control
3. Customer conversation data security is essential
4. Understanding customer sentiment, top questions, and common interactions are needed
5. Integrations with our current Dynamics 365 user base is critical
6. Conversations must be saved for at least two years
7. Solution must be intuitive with minimal learning curve
8. Should easily integrate with our suite of office software and business workflows
Technical Overview
There are multiple ways in which to approach this paradigm; however, the time constraint of implementing a scalable messaging solution within 2 to 3 weeks was motivation for using as much in place technology as possible and why we chose Microsoft Teams, conversation bots, and Azure for our solution.
The below reference architecture outlines the as-built solution, which includes the following components:
- Azure AD B2C
- Azure API Management (APIM)
- Azure App Services (Web and Messaging API)
- Azure Bot Registration Service
- MS Teams Conversation Bot
- MS Teams
- CosmosDB
- Notifications Hub
- Integrations – Azure Logic App, Function App, Service Bus, and D365 Common Data Service
Figure 1 – Teams Bot Solution Architecture
Component Architecture Examination
1. Mobile app incorporates a typical messaging component for sending and receiving messages.
2. All inbound traffic must go through APIM for first line of defense and examination for routing to the WebAPI.
3. Once traffic passes the APIM it can hit the various messaging calls including CRUD operations and Teams user ‘Presence’ indicator.
4. Messaging Service serves as the orchestrator for routing to the various backend resources including Azure Bot, CosmosDB, Notifications Hub, and Dynamics 365 CRM where messages get stored as Account Activities.
5. Azure Bot receives the mobile user message and pushes that message to the Teams Traffic Manager.
6. Teams America Traffic Manager endpoint (for today, for our region) and facilitate the Azure Teams bot wire up.
7. Teams Bot holds the commands for user interactions such as /Reply and /Help.
8. MS Teams where customer service or sales will respond to the mobile user message.
9. Bot authentication resides in the hands of Azure AD App Registration.
A. All send/receive messages are stored in CosmosDB containers for analysis and mobile app interactions.
B. Dynamics CRM holds the Teams users from customer service and sales and is integrated into the solution (CosmosDB) via Logic App, Service Bus, and Function App components.
C. Backend tells Notification Hub a new message is available from customer service and a push notification is sent to the mobile app.
Solution Synopsis
Conversations initiate from the mobile app where the user will have need to contact customer service or sales for various reasons such as project state, order processing, or patient information.
Mobile app messaging commands go through APIM to the Web API for authentication, validation, and routing to the called Messaging Service method. As previously stated, the Messaging Service acts as the command orchestrator.
1. Save sent and received messages to CosmosDB
2. Send direct messages to Teams user
3. Push Teams user replies to the mobile app
4. Instantiate push notification on message replies
5. Post all message data to Dynamics 365 CRM as an Account Activity
6. Integrate CRM customer service and sales account personnel
Messaging Services works in conjunction with the Azure and Teams Bots to help facilitate these commands.
Figure 2 depicts the start of a conversation between the mobile app user and customer service within the Teams client. The bot prepends the mobile user’s name, account number, and generates a unique message id, which will be used by customer service to keep the conversation going.
Example of how to code Teams Bot Reply Command [Stephen PhysicianC][Client A] Message Id: egCIsZbvGid – Hey (Microsoft Teams in Healthcare).
Figure 2 – Teams Bot Reply CommandThe /Reply along with the message id tells the bot to route the message back to the mobile user and extend the conversation. This satisfies the requirement of not having to add mobile users to the organizations AAD or Teams as guests, which greatly reduces maintenance and onboarding.
Figure 2 – Teams Bot Reply Command
Figure 3 displays the simple Bot Command available to the Teams user including /Reply, /Help, and /CacheTeamsInfo, which stores Teams data in CosmosDB for conversation setup from the mobile app side shown in Figure 4.
Figure 3 – Teams Bot Command Set
Figure 4 – Teams Bot / CacheTeamsInfo Command
Solution Security
Solution security is met with implementation of Azure ASE and ISE environments, data encryption at rest and in transit, APIM encrypted API calls (TLS & JWT), Bot and user authentication & authorization, and the suite of Azure tools for security, alerting, and logging.
Not depicted are the typical NSGs, RBACs, Firewall and a ‘assume breach’ posture required by healthcare systems today.
Conclusion
Messages can now be analyzed, insights gained, customer interactions bolstered, and no more text messages on employee mobile phones or emails that are hard to mine. The organization now has the well supported MS Teams as its messaging backbone.
Furthermore, messaging history can be viewed in Dynamics 365 CRM, Power BI is wired into CosmosDB messaging data for analysis, and the solution is set up for phase 2, which will include multiple AI components to better serve their customers.
Healthcare messaging just got better.