首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Azure Bot部署问题

Azure Bot部署问题
EN

Stack Overflow用户
提问于 2022-05-09 10:40:36
回答 1查看 119关注 0票数 0

我正在测试是否可以将虚拟机器人部署到Azure bot服务,并跨多个通道运行它。我使用Azure在ubuntu上部署机器人。我运行的命令是,(在Bot官方文档中找到的)

代码语言:javascript
复制
az deployment sub create --template-file "/home/abrar/Work/Bot_POC/testbot-1/deploymentTemplates/template-with-new-rg.json" --location centralindia --parameters appType="UserAssignedMSI" appId="blablabla" tenantId="blablabla2" existingUserAssignedMSIName="TitanBotName" existingUserAssignedMSIResourceGroupName="TitanBot" botId="/subscriptions/2d178cfc-3973-4e06-9ffe-15463849a46c/resourcegroups/TitanBot/providers/Microsoft.ManagedIdentity/userAssignedIdentities/TitanBotName" botSku=S1 newAppServicePlanName="titanbot" newWebAppName="TitanAssistBot" groupName="TitanBot" groupLocation="centralindia" newAppServicePlanLocation="centralindia" --name "TitanAssist"

我已经更改了appId和tenantId,以防万一。我收到的错误是,

代码语言:javascript
复制
{'code': 'InvalidTemplate', 'target': '/subscriptions/2d178cfc-3973-4e06-9ffe-15463849a46c/resourceGroups/TitanBot/providers/Microsoft.Resources/deployments/storageDeployment', 'message': "Deployment template validation failed: 'The template resource '/subscriptions/2d178cfc-3973-4e06-9ffe-15463849a46c/resourcegroups/TitanBot/providers/Microsoft.ManagedIdentity/userAssignedIdentities/TitanBotName' for type 'Microsoft.BotService/botServices' at line '1' and column '2061' has incorrect segment lengths. A nested resource type must have identical number of segments as its resource name. A root resource type must have segment length one greater than its resource name. Please see https://aka.ms/arm-template/#resources for usage details.'.", 'additionalInfo': [{'type': 'TemplateViolation', 'info': {'lineNumber': 1, 'linePosition': 2061, 'path': 'properties.template.resources[2].type'}}]}

从错误中,我假设template-with-new-rg.json有一些问题。我从约曼机器人生成器那里获得了创建一个空机器人的文件。在检查文件时,我注意到它有几个错误。链接到文件nodejs/02.echo-bot/deploymentTemplates/template-with-new-rg.json

我不知道接下来该怎么做,我试着按照VSCode终端的建议修复json文件,在修复这些文件时,我得到了另一种类型的错误。

代码语言:javascript
复制
{'code': 'InvalidTemplate', 'message': "Deployment template validation failed: 'The template resource 'storageDeployment' at line '152' and column '9' is invalid. 'ResourceGroup' property is not supported for nested deployments with api-version older than '2017-05-10'. Please see https://aka.ms/arm-template/#resources for usage details.'.", 'additionalInfo': [{'type': 'TemplateViolation', 'info': {'lineNumber': 152, 'linePosition': 9, 'path': 'properties.template.resources[1]'}}]}

对我现在能做什么有什么建议吗?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-05-09 22:05:14

这里有一些问题,我马上就能看到。

首先,botid是bot的名称,而不是ID号或订阅号。在这里输入一个唯一的bot名称,比如"TitanTestBot1“。此名称在Azure中必须是唯一的,因为Azure Bot资源不能在特定区域中创建,并且始终是全局的。

此外,您的服务计划名称也是titanbot。试着给它取个更好的名字。

最后,您告诉Azure资源组,您的托管标识(在创建bot资源之前必须已经存在)存在于名为TitanBot中,但您也表示希望为称为TitanBot的bot资源创建一个新的资源组。这两件事不可能都是真的。如果希望bot资源进入TitanBot,则需要使用preexisting-rg模板,而不是new-rg模板。如果您想要一个新的资源组,它必须有一个新的名称。

此时,您应该仔细检查将你的机器人发布到Azure文档中的所有字段,并确保为每个字段提供唯一和正确的条目。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72170670

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档