Botbuilder-samples: [netcore][52.enterprise] Following steps doesn't result in successful build for LUIS

Created on 23 Oct 2018  路  12Comments  路  Source: microsoft/BotBuilder-Samples

Github issues for C# /JS / Java/ Python should be used for bugs and feature requests. Use Stack Overflow for general "how-to" questions.

Sample information

  1. Sample type: [\samples\ or \solutions]
    samples
  2. Sample language: [dotnetcore or webapi or es6 or nodejs or typescript]
    dotnet
  3. Sample name:
    enterprise bot

Describe the bug

Give a clear and concise description of what the bug is.
The instructions say
"There are two locations that need to be updated in the code to resolve the LUIS service. In the following files: MainDialog.cs EnterpriseDialog.cs The following line needs to be updated in both files: var luisService = _services.LuisServices[_General]; The must be replaced with the provided in step 4 above."
but (1) this line doesn't exist in either file, and (2) replacing the closest line to it results in a "null", it's not actually hitting the service for some reason

Is there a known fix for this?

Thanks!
Anna

To Reproduce

Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior

Give a clear and concise description of what you expected to happen.

Screenshots

If applicable, add screenshots to help explain your problem.

Additional context

Add any other context about the problem here.

[bug]

bug

All 12 comments

Hi Anna, can you point me to where you saw these instructions? They are out of date and you no longer need to modify this code for the enterprise template to work. I will update the docs accordingly.

You do need to modify the code, at least as of this morning, to update the within the two dialogs the "name" of the luis services. for QnA, you no longer have to because it's default is FAQ

It's not in the docs but it is in the readme which you referenced

It looks like the code in the repo is out of date with the published Visual Studio Marketplace template. We've moved to https://github.com/Microsoft/AI for the latest builds. Would you mind trying to install and build from the template here and let me know if you have the same issues?

Maybe this will help. I'm pulling straight from the samples repo - could that be an issue? These are the steps I'm following (preparing an integration course and this will be part of setup, using the template as a base):

Lab 1.3: Setting up an instance of the Enterprise Bot Template

In this lab, we'll walk through how to get a base Enterprise Bot downloaded and deployed with the initial services, including Dispatch, LUIS, QnA Maker, Application Insights, Cosmos DB, Azure Web App Bot, and Azure Storage.

Step 1.3.1: Clone the samples repository

In the future, you may just want to use the VSIX template you downloaded in the previous lab (and now you know how). However, for this solution, the sample is still being updated, and, for now, we want to make sure we're using the most up-to-date template.

In the Cortana search bar, type "git bash" and select "Git Bash Desktop App", or type "cmd" and select "Command Prompt". Next, type cd c: then enter, and git clone https://github.com/Microsoft/BotBuilder-Samples.git then enter. This copies down all of the files from the GitHub site to C:\BotBuilder-Samples.

Step 1.3.2: Create a base solution

Open File Explorer and create a new folder on your desktop called "CSAgent". Next, navigate to "C:\BotBuilder-Samples\samples\csharp_dotnetcore\52.enterprise-bot". Use CTRL+A to select all the files, then CTRL+C to copy them. Navigate to the folder you just created on your Desktop, and use CTRL+V to paste the files into your "CSAgent" folder. Finally, double-click on the "EnterpriseBot" project file (of type "Visual C# Project File") to open it in Visual Studio 2017.

Step 1.3.3: Build the solution

In the solution explorer, right click on the solution and select "Rebuild Solution".

Step 1.3.4: Deploy the related services

This step has multiple steps.

  1. Install the BotBuilder-Tools (you can read about them here) by opening the Command Prompt and running:
    npm install -g chatdown msbot ludown luis-apis qnamaker botdispatch luisgen
  2. Open Windows PowerShell (on the DSVM this should be pinned to the taskbar).

    • To login, run Connect-AzureRmAccount

    • To select your Azure subscription, run `Select-AzureRmSubscription -Subscription "subscription-name".

  3. Sign in to luis.ai (in your browser of choice) and obtain your LUIS Authoring Key. You can find it by select Your Name > Settings from the top right corner. Copy the Authoring Key and open "keys.txt". Put the key and a descriptor so you know what it is.
  4. In the Command Prompt, run cd C:\Users\_your-username_\AppData\Roaming\npm to move to the project directory.
  5. Next, run the following command:
msbot clone services --name "CSAgent" --luisAuthoringKey "<YOUR AUTHORING KEY>" --folder "C:\Users\<YOUR-USERNAME>\Desktop\CSAgent\DeploymentScripts\msbotClone" --location "westus" --verbose

Note: By default, your Luis Applications will be deployed to your free starter endpoint. An Azure LUIS service will be deployed along with your bot but you must manually add and publish to it from the luis.ai portal and update your key in the .bot file.

  1. Select y then Enter when prompted to create the resources. And enter the device code in the browser when prompted. This will take several minutes, so be patient, but observe all the things that are being created for you! Want to review line-by-line with us?
  2. You need to save the bot secret within your "keys.txt" file.

Step 1.3.5: Updating the base solution

  1. Return to Visual Studio, and in appsettings.json, fill in your botFileSecret with the bot secret you collected in the previous step. Save the file.
  2. Right-click on the solution and select "Manage NuGet packages for solution". Under the installed tab, select "Microsoft.AspNetCore.All" and update the package to "2.1.4". Then, rebuild the solution.
  3. In File Explorer, navigate to C:\Users\_your-username_\AppData\Roaming\npm, copy the BOT File, and paste it into the root of your project (should be in a location similar to C:\Users\_your-username_\Desktop\CSAgent).
  4. Return to Visual Studio and open the file ending in ".bot". This file should contain all of the services created in step 6 along with their keys and any other information your bot will need to communicate with the services. One important thing to note is for each service, there is an item called "name". Sometimes the bot will find the service via "type" and sometimes via "name". You can set it to whatever you want, but leaving it as the default should be fine. In the "dispatch" service, you may note that it also has "serviceIds" that point to the LUIS and QnA services that Dispatch will route between.
  5. Note the "name" value for the LUIS model that has "_General" in the name. Within Dialogs > Main > MainDialog.cs _and_ within Dialogs > Shared > EnterpriseDialog.cs, replace "General" (in the line that calls _services.LuisServices) with the value for "name" (make sure it's placed within quotes).
  6. Return to the ".bot" file and note the "name" value for the QnA Maker service. In Dialogs > Main > MainDialog.cs, replace "FAQ" (in the line that calls _services.QnAServices) with the value for "name" (make sure it's placed within quotes).
  7. Finally, within appsettings.json, replace the "botFilePath" value with the name of your ".bot" file (and including ".bot" in the name). Save all files.

Step 1.3.6: Publishing the base solution

  1. Right-click on the project within Solution Explorer and select "Publish...". In the pop-up window, select "Select Existing", and use the drop-down next to the Publish button to select "Create Profile".
  2. Find and select the service that was created in an earlier step. Select OK.
  3. Select Configure > Settings > File Publish Options and check the box "Remove additional files at destination". Click "Save".
  4. Select "Publish" to publish your bot back up to the service.

As clarification, I've been writing and tweaking these steps as I run into issues. The VSIX template (which I think is what you linked to when you said "here") is out of date isn't it?

I guess my question is - is the most updated version the GitHub samples repo or VSIX template in marketplace?

The VSIX is actually the most up to date because the code is being managed in a separate repo from this one.

OK that is good to know. I'll start over from the VSIX template and report on any errors I come across. Bugs/comments for VSIX go https://github.com/Microsoft/AI/tree/master/templates/Enterprise-Template and bugs/comments for instructions go https://docs.microsoft.com/en-us/azure/bot-service/bot-builder-enterprise-template-deployment?view=azure-bot-service-4.0 . Correct?

Please submit all bugs and issues to https://github.com/Microsoft/AI/issues. We can update the public docs based on your feedback there!

Will do. thanks

Thanks for your patience!

Moving conversation to AI repo.

Was this page helpful?
0 / 5 - 0 ratings