Point Microsoft Bot DirectLine API to slot instance

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP



Point Microsoft Bot DirectLine API to slot instance



I would like to follow Azure best practices and utilize deployment slots for testing my chat bot. I have deployed 2 instances of my bot.


Production bot: https://[my-bot].azurewebsites.net
Staging bot: https://[my-bot-staging].azurewebsites.net



I have a DirectLine app that can successfully connect to my production bot, but do not know how to connect it to the staging instance.



The latest StackOverflow questions on this topic are old. The accepted answer here claims that you need 2 physical bots instead of using deployment slots: Setting up slots or multiple environments for Azure Bot Service



Is this still the case in 2018? How can I connect DirectLine to a staging slot?




1 Answer
1



I have a DirectLine app that can successfully connect to my production bot, but do not know how to connect it to the staging instance.



If you want your DirectLine app works with same bot service and connect it to your bot application hosting on staging slot, you can clone configuration for your staging slot from that existing production slot, and then replace Messaging endpoint with your staging bot application endpoint on your bot service Settings blade.



enter image description here



Besides, you can also create a Bot Channels Registration bot service to connect your bot application hosting on staging slot to other channels.



Please ensure that you provide/set settings for MicrosoftAppId and MicrosoftAppPassword of your bot app hosting on staging slot with Microsoft App ID and password of the corresponding Microsoft App that is created when you create Bot Channels Registration.



Test result:



enter image description here





From the bot channels registration page: "You only need to register your bot if it is not hosted in Azure. If you created a bot through the Azure portal then your bot is already registered with the Bot Service." My bot was created through the Azure portal. I only have one bot created, but 2 slots. Won't changing the messaging endpoint change even the production channels to point to the staging slot?
– Dan Oswalt
Aug 6 at 21:27






I only have one bot created, but 2 slots. Won't changing the messaging endpoint change even the production channels to point to the staging slot? As I mentioned in reply, if you clone configuration for your staging slot from that existing production slot, changing the messaging endpoint with staging bot application endpoint, your bot service would connect to your bot app hosting on staging slot.
– Fei Han
Aug 8 at 1:52


I only have one bot created, but 2 slots. Won't changing the messaging endpoint change even the production channels to point to the staging slot?





"You only need to register your bot if it is not hosted in Azure." Based on experience, I think it might be a documentation issue, bot channels registration bot service can also connect to bot application that is hosting in Azure. For example, I create a Azure web app and publish my bot application to that web app, and now I want to register my bot app, I can create a bot channels registration bot service to connect to that bot app and specify settings for MicrosoftAppId and MicrosoftAppPassword for my bot app, which would work too.
– Fei Han
Aug 8 at 2:06



"You only need to register your bot if it is not hosted in Azure."





Thank you Fei. The bot channels registration service is what I needed. This service does not create a new web app, but simply points to existing source code, which is staging in this case. Here is some documentation: docs.microsoft.com/en-us/azure/bot-service/…
– Dan Oswalt
Aug 8 at 22:33






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Firebase Auth - with Email and Password - Check user already registered

Dynamically update html content plain JS

Creating a leaderboard in HTML/JS