Closed Unders0n closed 6 years ago
Hi @Unders0n
Thank you for trying out the Enterprise Bot Template. The repository for issues related to this template is https://github.com/Microsoft/BotBuilder-samples/issues The BotBuilder repository issues is now for DCRs only. If you have further questions or issues related to the Enterprise Bot Template, please ask on Stack Overflow or BotBuilder-samples
1) The OPTIONS call is sent to the bot's messaging endpoint by the Azure Portal when you navigate to settings within the portal. Since only POSTs are handled by the bot's messaging endpoint, and not OPTIONS or GET or PUT, these other commands will result in 'not allowed'. You can add code to handle these call types, if you prefer. But, the failure of the OPTIONS call from the portal can be safely ignored.
2) "The bot is remote, but the service URL is localhost." means that ngrok is not properly configured for the emulator itself. Within the v4 Emulator, use the View -> Emulator Settings menus, and set the 'Path to ngrok':
The emulator repository has an open issue to make this wording more clear: https://github.com/Microsoft/BotFramework-Emulator/issues/878
@EricDahlvang Still my problem was not revealed in this answer, so i've created issue in repo you suggested: https://github.com/Microsoft/BotBuilder-Samples/issues/864
env: net core 2.1, c# bot builder 4.1.1 net.core.app 2.1.5 bot enterprice template (w\o running of az scripts)
what's done: i've created a chatbot app using latest enterprise template. I haven't run azure resource script though 'cos of inner policy, so we just created resourses using regular bot service creation and configured manually. I commented some services trying to minimize them to minimal set of working. I've commented Transcript Middleware, i changed State service to use MemoryStorage:
Took all app ids, keys and what is needed, configured my app. So when im running locally and testing using emulator, everythings work fine. Now i'm trying to connect bot service to my local app using ngrok tunnel to debug it. I'm running my app on 32618 port. I've done basic forwarding using ngrok:
ngrok.exe http 32618 -host-header="localhost:32618"
and now its listening on https://deb52201.ngrok.io , i've updated .bot file to use"endpoint": "https://deb52201.ngrok.io/api/messages"
, in launchSetytings i'm still using"applicationUrl": "http://localhost:32618".
Updated message endpoint in azure bot app to https://deb52201.ngrok.io/api/messagesproblem: when i'm using emulator it's working (both with local and external ngrok urls) , though it gives me error :Error: The bot is remote, but the service URL is localhost. Without tunneling software you will not receive replies" (dunno what it means by service URL is localhost). But when i'm trying to test using azure's Test in web chat i see error that message can't be sent. In ngrok i see in log that bot service was trying to call OPTIONS /api/messages and result is "not allowed". In vs i see this error: Microsoft.AspNetCore.Hosting.Internal.WebHost:Information: Request starting HTTP/1.1 OPTIONS http://localhost:32618/api/messages
Microsoft.AspNetCore.Hosting.Internal.WebHost:Information: Request finished in 4.3045ms 405 Application Insights Telemetry:
The thread 0xda4 has exited with code 0 (0x0).
When googling related problems i constantly see advice to change stateManager. but a) i have InMemory already (hope its configured right) 2)all examples are for old versions on web api, there's no such methods, i can't find any examples for Net Core and BorBuilder 4.1.
Full code: launchSettings:
Startup:
ChatbotLocal.bot:
Thanks