简体   繁体   English

如何发布Azure Bot

[英]How to Publish an Azure Bot

Just learning how to use Azure Bot Service and Azure Bot Framework . 仅学习如何使用Azure Bot ServiceAzure Bot Framework I created a Bot in Azure portal following this Official Azure tutorial. 我遵循官方Azure教程在Azure门户中创建了Bot。 Does this bot need to be published somewhere? 该机器人是否需要在某个地方发布? I read somewhere that you Build-->Test-->Publish-->Evaluate . 我读过您在Build-->Test-->Publish-->Evaluate某个地方。 I've tested it in Azure portal itself as explained here . 我在Azure的门户网站本身测试它作为解释在这里 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. Azure Bot通过将它们连接到现有渠道(例如Skype,Facebook Messenger,SMS等)或通过自定义应用程序进行REST调用来工作。

However you can also reach your bot directly from: https://webchat.botframework.com/embed/YOUR_BOT_ID?t=YOUR_TOKEN_HERE 但是,您也可以直接从以下https://webchat.botframework.com/embed/YOUR_BOT_ID?t=YOUR_TOKEN_HERE访问机器人: https://webchat.botframework.com/embed/YOUR_BOT_ID?t=YOUR_TOKEN_HEREhttps://webchat.botframework.com/embed/YOUR_BOT_ID?t=YOUR_TOKEN_HERE t https://webchat.botframework.com/embed/YOUR_BOT_ID?t=YOUR_TOKEN_HERE

You can embed it on any web page with this HTML tag: 您可以使用以下HTML标签将其嵌入到任何网页中:

<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. 机器人ID是您的机器人的名称,您可以通过以下方法从门户网站获取令牌:进入您的机器人并选择“通道”刀片,然后单击“获取机器人嵌入代码”链接。

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 编辑:我继续写关于这个主题的博客文章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 您可以在此处找到信息将机器人发布到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. 当您在Azure门户中创建Web应用程序漫游器时 ,将为该漫游器创建一个应用 程序服务 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. 您可以通过在创建bot的天蓝色资源组中进行检查。现在Web应用程序可以确保的是,该bot已经在线(可用于世界各地),因此它已经发布。

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 : 就像乔尔·格拉(Joel Guerra)提到的那样,网只是一个渠道,而默认情况下启用了一个渠道,查看方式是:

  1. Open your bot in the Azure Portal and click Channels blade. 在Azure门户中打开您的漫游器,然后单击“ 通道”刀片。
  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. 因此,嵌入代码实际上是一个iframe,您可以将其放置在您的网站中或与其他想使用您的漫游器的人共享。 Or you can use the src of the iFrame too to reach the bot directly. 或者,您也可以使用iFrame的src直接访问该机器人。

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. 您可以查看“ 配置渠道”文档,了解在更多渠道(如Skype,Microsoft Teams,电子邮件,Facebook,Slack,Telegram等)中启用漫游器的步骤。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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