0
votes

I have created a bot in Azure Bot Service, but I am trying to transfer it into an httptrigger than I can call.

However, I am struggling with formatting the data and how this would work.

Within a queuetrigger, I would like to call the httptrigger and pass along an id (which was in the queue) to the httptrigger (bot) to then use that id to search a documentdb and retrieve some data to be used during a Direct Line message.

Any help here would be appreciated.

N.B. The bot works fine in the emulator etc, I am unsure how to transfer it to an httptrigger so I can call it.

1

1 Answers

0
votes

If the host plan you chosed when creating the Azure Bot Service is Consumption plan, then the default bingding type of your bot is httpTrigger. You can find the configuration in function.json.

Then you can navigate to SETTING => Configuration you can find your Azure Bot Service's endpoint which should be https://<botname>.azurewebsites.net/api/messages?code=....... Then you can leverage this endpoint to build your client via Direct line via https://docs.microsoft.com/en-us/bot-framework/rest-api/bot-framework-rest-direct-line-3-0-concepts.

Addionally, for your requirement, I think you can refer to Azure Function which I think is better for your scenario with less efforts.

Edit

I can actually create an httptrigger in Azure Functions with my bot code using the bot builder sdk

Yes you are right. You need to chose the Hosting Plan when you create an Azure Bot Service, once you created, it cannot be change. The Hosting Plan dropdown list is in the creataion blade: enter image description here

If I created an App Service Plan where would I still be able to find the endpoint?

You can find the endpoint in Overview blade in your Azure App Service application: enter image description here

Additionally, if you chose Azure App Service Hosting Plan, you need to enable Always on feature for httptrigger. Refer to https://docs.microsoft.com/en-us/azure/app-service/web-sites-configure for more info.