使用 github 操作的 Azure 机器人作曲家 CICD

问题描述 投票:0回答:1

我想知道是否有任何方法可以在本地部署在Azure bot Composer中编写的机器人代码并将代码推送到github,并进一步使用需要将代码部署到azure web应用程序的github操作。

我已经阅读了微软官方文档,对 bot Composer CICD 进行了重新分级,但其中包含 .net 中的代码并且仅使用 Azure DevOps。我找不到任何方法来部署使用 bot Composer 制作并使用 github actions 部署的基于 Node js 的机器人

我了解工作流程和 github 操作,但不知道机器人模板和部署它的工作流程步骤

azure azure-web-app-service bots github-actions botframework
1个回答
0
投票

按照以下步骤将通过 Bot Composer 生成的 NodeJS Bot 应用程序部署到 Azure。

  • 我已经通过 Bot Composer 创建了一个 NodeJs Bot 应用程序,并在本地按预期运行。

enter image description here

创建项目后,导航到终端中项目的 Scripts 文件夹并运行以下命令:

  • 这是为了配置新的 Azure 资源。
npm install
node provisionComposer.js --subscriptionId=<YOUR AZURE SUBSCRIPTION ID> --name=<NAME OF YOUR RESOURCE GROUP> --appPassword=<APP PASSWORD> --environment=<NAME FOR ENVIRONMENT DEFAULT to dev>

(或)

您还可以在 Bot Composer 中配置 Azure 资源。

  • 单击 Bot Composer 中的发布图标=>选择您的项目=>管理配置文件 Se

  • 它将重定向到发布配置文件=>添加新=>选择将机器人发布到Azure并提交。

enter image description here

enter image description here

  • 配置资源如下图:

enter image description here

enter image description here

enter image description here

  • 已将整个项目代码推送到GitHub:

enter image description here

  • 转到您新创建的
    web app=>Deployment Center=>Select source as GitHub and select GitHub repository of your Bot Project
    。这将启动项目并将其部署到应用服务:

enter image description here

您可以在

Project=>Settings=>appsettings.json

中检查发布配置
"publishTargets": [
    {
      "configuration": "{\n  \"name\": \"kpnodewebapp\",\n  \"environment\": \"composer\",\n  \"tenantId\": \"72f988bf-86f1-41af-91ab-2d7cd011db47\",\n  \"subscriptionId\": \"b83c1ed3-c5b6-44fb-b5ba-2b83a074c23f\",\n  \"resourceGroup\": \"resourcegroupname\",\n  \"botName\": \"<azurebotname>\",\n  \"hostname\": \"webappname\",\n  \"runtimeIdentifier\": \"win-x64\",\n  \"region\": \"westus\",\n  \"appServiceOperatingSystem\": \"linux\",\n  \"settings\": {\n    \"applicationInsights\": {},\n    \"luis\": {},\n    \"qna\": {},\n    \"MicrosoftAppId\": \"2XXXXXXXXXXXXXXXXX7447\",\n    \"MicrosoftAppPassword\": \"QYS8Q~1UXXXXXXXXXXXXXXXXXW-SYRcHjbiP\"\n  }\n}",
      "name": "webappname",
      "type": "azurePublish"
    }
  ],

传送门:

  • 我可以部署并测试机器人,如下所示:

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.