简体   繁体   中英

How to Publish an Azure Bot

Just learning how to use Azure Bot Service and Azure Bot Framework . I created a Bot in Azure portal following this Official Azure tutorial. Does this bot need to be published somewhere? I read somewhere that you Build-->Test-->Publish-->Evaluate . I've tested it in Azure portal itself as explained here . Not sure about the Publish part of it.

How do you intend to use your bot? Azure Bots work by connecting them to existing channels like Skype, Facebook Messenger, SMS, etc or making REST calls from a custom application.

However you can also reach your bot directly from: https://webchat.botframework.com/embed/YOUR_BOT_ID?t=YOUR_TOKEN_HERE

You can embed it on any web page with this HTML tag:

<iframe src="https://webchat.botframework.com/embed/YOUR_BOT_ID?t=YOUR_TOKEN_HERE"></iframe>

Please note that both of these methods expose your token and would allow other developers to add your bot to their pages as well.

Bot ID is the name of your bot and you can get the token from the portal by going to your bot and choosing "Channel" blade and then clicking the "Get bot embed codes" link.

Edit: I went ahead and wrote a blog post on this topic https://medium.com/@joelatwar/how-to-embed-your-azure-web-app-bot-in-any-web-page-120dfda91fdc

You can find information here Publish bot to BotService

Hope this helps.

When you create a web app bot in the Azure portal, an App service for the same bot would have been created. You can check this by going to the resource group in azure where you had created the bot in. Now what the web app ensures is that, the bot is already online (available to the world), so its already published.

Now the next question that comes is, how to make the other people / users use the bot, so that's where the channel comes in. Consider channel as a medium by which you enable your bot for others to use with a much better user experience.

There are multiple channels available for the bot to be published in, and yes you can publish the same bot in all the channels. Like Joel Guerra mentioned, webchat is just one channel and the one which is enabled by default and the way to see it is :

  1. Open your bot in the Azure Portal and click Channels blade.
  2. Click Edit for the Web Chat channel
  3. Under Secret keys , click Show for the first key 在此处输入图片说明
  4. Copy the Secret key and the Embed code .
  5. Click Done

So the embed code is actually an iframe which you can place in your website or share with others who want to use your bot. Or you can use the src of the iFrame too to reach the bot directly.

Again this is just one channel. You can take a look at the Configure channels documentation for steps to enable the bot in more channels like Skype, Microsoft Teams, Email, Facebook, Slack, Telegram, etc.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM