[英]Publish a Bot created in Bot framework Composer using Azure CLI
I created a bot in Bot framework Composer, it works fine locally and using Bot Framework emulator, and when I publish it using the Composer publish features it works fine.我在 Bot Framework Composer 中创建了一个机器人,它在本地和使用 Bot Framework 模拟器时工作正常,当我使用 Composer 发布功能发布它时它工作正常。 But I need to publish the bot using Azure CLI, I tried following the steps in this doc: https://learn.microsoft.com/en-us/azure/bot-service/provision-and-publish-a-bot?view=azure-bot-service-4.0&tabs=multitenant%2Ccsharp#create-resource-groups但我需要使用 Azure CLI 发布机器人,我尝试按照此文档中的步骤操作: https://learn.microsoft.com/en-us/azure/bot-service/provision-and-publish-a-bot?查看=azure-bot-service-4.0&tabs=multitenant%2Ccsharp#create-resource-groups
I created an app registration, a web app and a bot.我创建了一个应用程序注册、一个 web 应用程序和一个机器人。 but when I try to access the bot using the "web chat" feature in the Azure portal I get error "There was an error sending this message to your bot: HTTP status code NotFound".但是当我尝试使用 Azure 门户中的“网络聊天”功能访问机器人时,出现错误“将此消息发送到您的机器人时出错:HTTP 状态代码 NotFound”。
These are the commands I used to create the resources and publish the bot:这些是我用来创建资源和发布机器人的命令:
Create App registration and secret:创建应用程序注册和秘密:
az ad app create --display-name "test" --sign-in-audience "AzureADandPersonalMicrosoftAccount"
az ad app credential reset --id "<app_id>"
Create Web app:创建 Web 应用程序:
az deployment group create --resource-group "test" --template-file "C:\..\template-BotApp-with-rg.json" --parameters "@C:\..\parameters-for-template-BotApp-with-rg.json"
Create Azure Bot:创建 Azure 机器人:
az deployment group create --resource-group "test" --template-file "C:\..\template-AzureBot-with-rg.json" --parameters "@C:\..\parameters-for-template-AzureBot-with-rg.json"
Prepare deployment and publish to Azure bot:准备部署并发布到 Azure 机器人:
az bot prepare-deploy --lang Csharp --code-dir "C:\" --proj-file-path "C:\..\test.csproj"
az webapp deployment source config-zip --resource-group "test" --name "test" --src "C:\..\test.zip"
I got the templates files from here: https://github.com/microsoft/botbuilder-do.net/tree/main/generators/do.net-templates/Microsoft.BotFramework.CSharp.EchoBot/content/DeploymentTemplates/DeployUseExistResourceGroup我从这里得到模板文件: https://github.com/microsoft/botbuilder-do.net/tree/main/generators/do.net-templates/Microsoft.BotFramework.CSharp.EchoBot/content/DeploymentTemplates/DeployUseExistResourceGroup
I updated the appsettings.json with AppID and password, and I copied the.sln file to the root folder then zipped the root folder:我用 AppID 和密码更新了 appsettings.json,然后将 .sln 文件复制到根文件夹,然后压缩根文件夹:
single-tenant
will support Azure Bot and C# and JavaScript SDKs single-tenant
将支持Azure Bot和C#和JavaScript SDKsMulti-tenant
Support Azure Bot Service, all frameworks SDK language, composer the Emulator and Ngok . Multi-tenant
支持Azure Bot 服务,所有框架 SDK 语言,编写 Emulator 和 Ngok 。-Make sure you are using setting which are used for specific deployment in the document. -确保您使用的设置用于文档中的特定部署。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.