Azure Bot部署的问题
我正在测试以检查是否可以将虚拟机器人移动到Azure机器人服务并跨多个渠道运行。我正在使用Azure CLI在Ubuntu上部署机器人。我运行的命令是(在bot SDK官方文件中找到),
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,以防万一。我收到的错误是,
{'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'}}]}
我假设模板与new-rg.json 有一些问题。我从Yeoman Bot-Builder获取器创建一个空的机器人中获得了该文件。检查文件后,我注意到它有几个错误。链接到文件 https://github.com/microsoft/botbuilder-samples/blob/main/samples/javascript_node_node_nodejs/02.echo-bot/deploymenttemplates/template-new-new-new-rg.json---rg.json
i “我不确定该怎么做,我尝试按照VSCODE终端建议修复JSON文件,并在修复这些文件时,我会收到另一种类型的错误。
{'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]'}}]}
关于我现在可以做什么的建议?
I'm testing to check if I can deploy a dummy bot to Azure Bot Services and run it across multiple channels. I'm using Azure CLI to deploy the bot on ubuntu. The command I ran was, (found on Bot SDK official documentaion)
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"
I've changed the appId and tenantId just in case for this post. The error I'm receiving is,
{'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'}}]}
From the error I'm assuming the template-with-new-rg.json has some issues. I got the file from creating an empty bot from Yeoman bot-builder-generator. Upon checking the file I noticed that it had a couple of errors. Link to the file https://github.com/microsoft/BotBuilder-Samples/blob/main/samples/javascript_nodejs/02.echo-bot/deploymentTemplates/template-with-new-rg.json
I'm not sure what to do from here, I've tried fixing the json file as suggested by VSCode terminal and upon fixing those, I'm getting another type of error.
{'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]'}}]}
Any suggestions on what I can do now?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这里有一些错误,我可以立即看到。
首先,
botid
是机器人的名称,而不是ID号或订阅号。在此处输入唯一的机器人名称,例如“ titantestbot1”。该名称必须在Azure中是唯一的,因为无法在特定区域中创建Azure Bot Resources,并且始终是全局的。此外,您的服务计划名称也是
Titanbot
。尝试给它一个更好的名字。最后,您正在告诉Azure资源组,您的托管身份(必须在创建bot资源之前必须已经存在),称为
titanbot
,但是您也说您要创建一个新的机器人资源的资源组,称为titanbot
。这两件事都不是真的。如果您希望bot Resources进入TitanBot
,则需要使用preexisting-rg
模板,而不是new-rg
template。如果您想要一个新的资源组,则必须有一个新名称。此时,您应该仔细检查将您的机器人发布到Azure 文档,并确保您为每个字段提供独特而正确的条目。
There are a few of things wrong here that I can see immediately.
Firstly,
botid
is the name of the bot, not an ID number or subscription number. Enter a unique bot name here, such as "TitanTestBot1". This name must be unique across Azure, as Azure Bot resources cannot be created in a specific region and are always global.Additionally, your service plan name is also
titanbot
. Try giving it a better name.Finally, you're telling Azure the resource group that your managed identity (which must already exist before creating a bot resource) exists in is called
TitanBot
, but you're also saying you want to create a new resource group for the bot resources calledTitanBot
. These two things cannot both be true. If you want the bot resources to go intoTitanBot
, you need to use thepreexisting-rg
template, not thenew-rg
template. If you want a new resource group, it must have a new name.At this point, you should carefully review all of the fields in the Publish your bot to Azure docs and make sure you're giving each field a unique and correct entry.