botbuilder-js: getting error applicationId of undefined for luis while integrating bot composer luis todo bot using Botbuilder-js sdk

Issue

we are using bot builder-JS SDK with version 4.11.0 . We are taking the bot files from the bot composer and trying to run bot with that files. We integrated the files and able to run the bot but when we are using luis it is asking for the secret keys and we are passing it through expression as we get from the bot composer but it was unable to get the keys.

When we checked in the bot composer folder the folder structure is like this image

From here we have . dialog file for every parent and child dialogs in recognizer folder and there is appsettings.json and luis.settings.composer.westus.json file. The content in the dialog file will be like this, there are expressions to get the keys

{
  "$kind": "Microsoft.LuisRecognizer",
  "id": "LUIS_additem",
  "applicationId": "=settings.luis.additem_en_us_lu.appId",
  "version": "=settings.luis.additem_en_us_lu.version",
  "endpoint": "=settings.luis.endpoint",
  "endpointKey": "=settings.luis.endpointKey"
}

So, we kept the secret keys in two .json files but when we run the bot it is unable to get the keys from the json files and getting error that application ID of undefined for luis image

Solutions we tried

We removed the expression in the .dialog file and placed the secret keys in the file bot working fine.

Our question

Is there any function in botbuilder-js SDK that it will take the settings from the appsettings.json file? Or is there any way to set the settings so that when the bot runs it will take from the appsettings.json or .env file

@stevengum please help us in solving this issue.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 17 (3 by maintainers)

Most upvoted comments

@dmvtech tried with prediction resources but unable to resolve the Issue. I tried to check in code of botbuilder-js modules, correct me if I gave wrong information.

checked from where getting the error "Invalid applicationId value detected: undefined Please make sure your applicationId is a valid LUIS Application Id, e.g. "b31aeaf3-3511-495b-a07f-571fc873214b"." got to know that it is from validateLuisApplication() function and this function is used in constructor to check the Luis key. I tried to log the values of application because from that taking the applicationId, endpoint, endpointKey values.

image

Tried two scenario’s Without giving the applicationId and endpointKey in ToDoBotWithLuisSample-0.en-us.lu.dialog file image Logs image If the equations for applicationId and endpointKey getting the values are undefined.

With giving the applicationId and endpointKey in ToDoBotWithLuisSample-0.en-us.lu.dialog file tempsnip Logs tempsnip If we gave the direct values application getting the values.

could you please explain us why applicationId and endpointKey are getting the their default values i.e. undefined when we tried to give the applicationId by an equation.

I am investigating this.