Integrate Azure Health Bot with Application Insights

Integrate Azure Health Bot with Application Insights

This post will learn how to integrate Azure Health Bot with Application Insights and capture the custom telemetry. Microsoft Azure Bot Services provides a managed platform for developing intelligent, enterprise-grade chatbots. The Azure Health Bot Services let us start building a bot with a predefined set of data. It abstract out the complex part of data validation, regulation, data privacy from the platform. With the power of Azure Platform, you can run this chatbot on any platform, including Web, Desktop, integrate with Whatsapp, Microsoft Team. Also, you can extend this to any other external interface using Directline APIs.

You can easily create your first AI-powered, compliant Chatbot using Azure Health Bot and start expanding this across the different channels and also integrate with Microsoft Teams for organization-wide distribution. No matter what channel you use to distribute your Azure Health Bot, capturing the telemetry of your Bot is always critical for continuous improvement and understand the real usages. In the previous post, we have learned about Audit Trail and Access Telemetry with Azur Health Bot. In this post, let us understand how we can integrate the Azure Health Bot with Application Insights.

Related Post:

Azure Health Bot Events and Telemetry – Audit Trails and Application Insights

Audit Trails for Azure Health Bot helps us track most of the events across. This included anything related to bot level changes such as adding scenarios, removing scenarios., However, if you want to capture telemetry using Application Insights, you can also do that.

Azure Health Bot Events and Telemetry with Application Insights
Application Insights Integration with Azure Health Bot

Integrate Azure Health Bot with Application Insights

During the time of bot creation, Azure creates only the Instance of “Azure Health Bot.” To be associated with an Application Insights instance, you need to create one new instance or use the existing one. No matter what, you need the Instrumentation Key

Instrumentation Key

Once you have the Instrumentation Key, Navigate to your health bot management studio. Select “Secrets” option available under “Integration

Secrets in Azure Health Bot Management Studio
Integration > Secrets

Under the Secrets & Keys, move to the Custom Telemetry Section, and enter the Application Insights Instrumentation Key. Click on Save.

Application Insights  with Azure Health Bot Custom Telemetry

That’s it. Application Insigts will have the events captured for the specified chat bot.

Conversation Log Capturing

By default conversation log is Disabled, and it will not include any content between a bot and end-user. If you want to capture them ( ensure all privacy and data protection policy as it may include PHI), you need to explicitly turn it on.

Conversation Log
Conversation Log

With “Include conversation text in Custom Telemetry” enabled, while saving you will receive the following disclaimer message. So you must ensure you are honoring all policies related to data capturing.

Application Insights  with Azure Health Bot

View Data in Application Insights

Once the integration is done, go ahead and test your bot and you will find the data is capturing in Application Insights.

Application Insights  with Azure Health Bot

Connect 1:1 with Abhijit – Speed Mentoring Program

Abhijit Jana

Abhijit runs the Daily .NET Tips. He started this site with a vision to have a single knowledge base of .NET tips and tricks and share post that can quickly help any developers . He is a Former Microsoft ASP.NET MVP, CodeProject MVP, Mentor, Speaker, Author, Technology Evangelist and presently working as a .NET Consultant. He blogs at , you can follow him @AbhijitJana . He is the author of book Kinect for Windows SDK Programming Guide.

2 Comments to “Integrate Azure Health Bot with Application Insights”

Comments are closed.