microsoft / BotFramework-Composer

Dialog creation and management for Microsoft Bot Framework Applications
https://docs.microsoft.com/en-us/composer/
MIT License
868 stars 372 forks source link

Luis prediction not working when published to regions out of westus #4663

Closed feich-ms closed 3 years ago

feich-ms commented 3 years ago

Describe the bug

Luis prediction doesn't work when publishing models to regions out of westus, e.g. westeurope. The luis publishing succeed, but the prediction keep failing due to prediction endpoint key not found.

Version

Main branch

Browser

OS

To Reproduce

Steps to reproduce the behavior:

  1. Create a bot with luis
  2. publish it to westeurope region with an authoringKey of same region
  3. Test with emulator to trigger the luis model
  4. You will find error message “” is not a valid LUIS application id.

Expected behavior

The luis model in bot should be able to predict user input

Screenshots

Additional context

luhan2017 commented 3 years ago

I've investigated this with Fei and we found that, composer does not use authoringRegion and region correctly in some places. Here are the details: We have two kind of luis services in composer: Authoring and Prediction. We should have following luis settings for the two services:

  "luis": {
    "authoringKey": "",
    "authoringRegion":"",
    "authoringEndpoint": ""
    "endpointKey": "",
    "region": "",
    "endpoint": "",
  },

For local publish, if endpointKey is null or empty, we'll use the authoringKey as the endpointKey, at this time, we should also set region to authoringRegion, and in composer runtime, we should always just take the endpointKey and region to call luis service.

But today, we don't have region setting, and don't set that, which will be confusing and error-prone.

For azure publish, we should also set both settings and use them separately, authoringKey and authoringRegion should be used to create luis applications, endpointKey and region should be used in runtime to call luis service.

But today, when we generate luis.settings.{environment}.{region}.json, we didn't care about the prediciton service binding, just all use the authoringRegion.

I will go through with all the luis region footprints with Fei together to make sure, we have correct logic with luis regions both in composer and cli.