I have been testing some botbuilder samples in python with Bot Framework Emulator, both on localhost. But in order to understand how the communication was happening, I decided to make the requests via Postman through Direct Line 3.0. Despite being able to create a conversation, send messages and receive the activities of a conversation, I cannot create the Direct Line Channel via Postman for my bot, only through the Bot Framework Emulator.
To do the test I do the following steps:
- I run any python Bot Framework Samples on my computer on port 3978
- I open a conversation in Bot Framework Emulator through port 3978. (At this point, the emulator tells me that it opened a service on port 49780.)
Emulator listening on http://[::]:49780
- I make a Direct Line request on port 49780 through Postman to create a conversation.
I would like to do step 2 without using the Bot Framework Emulator, either through the REST API or through the Python code.
Step 2 is not really about creating a conversation. It's more to do with the Emulator creating a tunnel to emulate the connection between the bot and the Azure Bot Service. This is not something you would control in a live deployment scenario. In a proper deployment, the Azure Bot Service will automatically handle routing messages from various channels to the bot's messaging endpoint. All you would need to do is communicate with the bot over Direct Line as normal.
Since Direct Line requires the Azure Bot resource to function (which the Emulator well, emulates) the only way to test it without the Emulator would be to create an Azure Bot resource, create a secure tunnel with something like ngrok, and set the ngrok URL as your messaging endpoint in Azure. At that point, Direct Line messages should reach your bot.