Skip to content

Latest commit

 

History

History
 
 

20.qna-with-appinsights

QnA with Application Insights

This sample demonstrates how to integrate QnA Maker to a bot with ASP.Net Core 2 and Application Insights.

This bot has been created using Microsoft Bot Framework.

This samples shows how to:

  • Use QnA Maker to implement core AI capabilities
  • How to use Middleware to log messages to Application Insights.
  • How to log QnA Maker results to Application Insights.
  • View metrics using a PowerBI report, Azure Monitor queries or Visual Studio

Prerequisites

This samples requires prerequisites in order to run.

To run the bot

  • Setup QnA Maker Assuming prerequisites have been installed:

    # log into Azure
    az login
    # set you Azure subscription
    az account set --subscription "<azure-subscription>"
    # Create QnA Maker service application
    msbot clone services --name "<your-bot-name>" --location <azure region like eastus, westus, westus2 etc.> --folder "DeploymentScripts/MsbotClone" --verbose
  • Start the bot

    • If using Visual Studio:

      • Navigate to the samples folder (botBuilder-samples\samples\csharp_dotnetcore\20.qna-with-appinsights) and open QnAABotAppInsights.csproj in Visual Studio.
      • Run the project (press F5 key)
    • If using .NET Core CLI:

      • Using the command line, navigate to botBuilder-samples\samples\csharp_dotnetcore\20.qna-with-appinsights folder.
      • Type dotnet run.

Testing the bot using Bot Framework Emulator v4

Microsoft Bot Framework Emulator is a desktop application that allows bot developers to test and debug their bots on localhost or running remotely through a tunnel.

  • Install the Bot Framework Emulator version 4.1.0 or greater from here

Connect to the bot using Bot Framework Emulator v4

  • Launch Bot Framework Emulator
  • File -> Open Bot Configuration
  • Navigate to botBuilder-samples\samples\csharp_dotnetcore\20.qna-with-appinsights folder
  • Select <your-bot-name>.bot file

Deploy the bot to Azure

After creating the bot and testing it locally, you can deploy it to Azure to make it accessible from anywhere. To learn how, see Deploy your bot to Azure for a complete set of deployment instructions.

View metrics

Further reading