Search code examples
botframeworkazure-cognitive-servicesazure-bot-serviceazure-language-understanding

Where can I get the LuisAPIKey and LuisAPIHostName?


I'm developing a Chatbot using Bot Framework v4 SDK by Microsoft and I wanted to give him some language understanding, so I created a LUIS App for it's purpose. Then I was trying to integrate my LUIS App into a bot, in this case, the Core Bot template available on the Bot Framework v4 SDK, where it says that for it to use a LUIS App I have to give him a LuisAppId which I found and two other that I don't see where can I find them. Those two are the LuisAPIKey and the LuisAPIHostName.

In the Core Bot template there is a appsettings.json file with these lines, and I'm trying to get the value for the last two.

"LuisAppId": "",
"LuisAPIKey": "",
"LuisAPIHostName": ""

I suspect the LuisAPIHostName is westeurope.api.cognitive.microsoft.com because I set the App location to be West Europe, but I'm not sure, and I have no clue where to find the LuisAPIKey.

Thank you all for your time in advance!!!


Solution

  • First, I'm assuming here you created both an Authoring and a Prediction resource. You will need both. If you go to the Manage Tab (where you likely found AppId under settings), you can select Azure Resources on the left. If you created the Authoring and Prediction resources at the same time I think they'll be linked already; regardless if you don't have a resource here you'll need to link it. This is the API Key you'll need. And yes, westeurope.api.cognitive.microsoft.com should be correct for the API Endpoint. Note that in Azure Resources section you'll see something like luisPredictionResourceName.cognitiveservices.azure.com. In theory I think this will work too, but I've always used the regional endpoint as you have mentioned.