Skip to content

Latest commit

 

History

History
 
 

21.luis-with-appinsights

LUIS with Application Insights

Bot Framework v4 LUIS with AppInsights bot sample

This sample shows how to create a bot that uses Language Understanding (LUIS) with Application Insights to record information about your bot and your LUIS application's performance.

This bot has been created using Microsoft Bot Framework.

This samples shows how to:

  • Use LUIS to implement core AI capabilities
  • How to use Middleware to log messages to Application Insights
  • How to log LUIS 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

  • Clone the repository
    git clone https://github.com/microsoft/botbuilder-samples.git
  • In a terminal, navigate to samples/javascript_nodejs/21.luis-with-appinsights
    cd samples/javascript_nodejs/21.luis-with-appinsights
  • Install modules
    npm install
  • Setup LUIS Assuming prerequisites have been installed:
    # log into Azure
    az login
    # set you Azure subscription
    az account set --subscription "<azure-subscription>"
    # Create LUIS service application
    msbot clone services --name "<your-bot-name>" --luisAuthoringKey "<luis-authoring-key>" --location <azure region like eastus, westus, westus2 etc.> --folder "deploymentScripts/msbotClone" --verbose
  • Make sure that the name property of your LUIS service in your .bot file matches LUIS_CONFIGURATIONS in index.js.
  • Start the bot
    npm start

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.

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 from here.

Connect to bot using Bot Framework Emulator v4

  • Launch Bot Framework Emulator
  • File -> Open Bot Configuration and navigate to BotBuilder-Samples/botbuilder_samples/samples/javascript_nodejs/21.luis-with-appinsights
  • 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