azurebotframeworkchatbotazure-bot-service

Can't deply echo bot to azure bot services


I'm creating my first chat bot in azure + c# (in general I'm novice in azure too). I've downloaded BotFramework v4 SDK Templatests for VS22 and use a simple echo bot. It works localy with Bot Framework emulator (with this endpoint http://localhost:3978/api/messages).

enter image description here

Now I want to install this bot on azure. I used these steps:

  1. In VS with "Publish" wizard I've create an azure web app.
  2. When I run this app from azure (https://myapp.azurewebsites.net/) I see a default web page with "Your bot is ready!" and steps that suggest using emulator or visit "Azure Bot Service" to register your bot. I need the second one but can't really open the provided link. It goes to https://azure.microsoft.com/en-us/products/bot-services which loose authentication, so it simply says you can use "Azure Bot Service". LogIn doesn't really help since it redirects just on the root azure portal page.
  3. However, I think I know how the above issue can be solved. I've simply created a new "Azure Bot (Microsoft)" in Bot services manually.

enter image description here

  1. Now, I want to connect my echo bot logic in the deployed web application with the created azure bot from services. As far as I can understand, for this I should provide "https://myapp.azurewebsites.net/api/messages" to the Messaging endpoint uri and then I should be able to check my bot in Test in Web Chat window. But I see nothing there, No hello message, no output, no errors. I only see that my test request message was sent.

enter image description here

I've described pretty all steps I have done, what could I miss? I assume my application is not visisble for chat bot for some reason, how can I troubleshot it? Any other suggestions are welcome.

UPDATE: Initially all 4 fields configuration in appsettings.json in my c# application were missed. Now they have the following values:

  1. MicrosoftAppType - still nothing. I don't know yet which value should be here.
  2. MicrosoftAppTenantId - I found this value in Azure Active Directory -> App registrations -> My Azure Bot name -> Overview -> Directory (tenant) ID
  3. MicrosoftAppId - I took this value from My azure bot service page -> Configuration -> Microsoft App ID (Manage Password)
  4. MicrosoftAppPassword - This value is taken from My azure bot service page -> Configuration -> Clicking on Microsoft App ID (Manage Password) link -> New Client secret -> Value.

I'm not 100% confident that all these values are taken from the right place and what value should be in MicrosoftAppType

UPDATE2: I've found description for appsettings.json fields here in section Bot identity information. I assume I need to use UserAssignedMSI MicrosoftAppType, so the values are slightly modified:

"MicrosoftAppType": "UserAssignedMSI",
"MicrosoftAppId": "%Microsoft_App_ID_(Manage_Password)_from_bot_service_configuration%",
"MicrosoftAppPassword": "",
"MicrosoftAppTenantId": "%tenantId%"

still gives the same result without errors or any output.


Solution

  • Oh, my bot application is actually MultiTenant app, as soon as I've changed it, it became working. I have a question whether I can have it configured as singletenant, but it's probably a diff question. Resolved.