gpt4 book ai didi

azure - Arm 模板验证通过 Azure Devops 版本失败,可通过 powershell 和 test-AzResourceGroupDeployment 运行

转载 作者:行者123 更新时间:2023-12-03 05:38:50 24 4
gpt4 key购买 nike

我有一个发布设置,正在尝试通过 Azure DevOps 发布管道进行发布。这是基于我克隆的另一个版本并且运行良好。

问题是模板未通过验证检查并且无法进一步进行。奇怪的是我能够使用 new-AzResourceGroupDeployment 和 test-AzResourceGroupDeployment 成功检查语法。它没有报告任何错误并且部署正常。

使用 Azure Devops 版本返回的错误是:

2020-02-26T12:26:16.2632844Z ==============================================================================
2020-02-26T12:26:16.2633634Z Task : ARM template deployment
2020-02-26T12:26:16.2634204Z Description : Deploy an Azure Resource Manager (ARM) template to all the deployment scopes
2020-02-26T12:26:16.2634534Z Version : 3.1.19
2020-02-26T12:26:16.2634945Z Author : Microsoft Corporation
2020-02-26T12:26:16.2635504Z Help : https://learn.microsoft.com/azure/devops/pipelines/tasks/deploy/azure-resource-group-deployment
2020-02-26T12:26:16.2635948Z ==============================================================================
2020-02-26T12:26:16.8677026Z ARM Service Conection deployment scope - Subscription
2020-02-26T12:26:16.8760315Z Checking if the following resource group exists: myResourceGroup.
2020-02-26T12:26:17.2234188Z Resource group exists: true.
2020-02-26T12:26:17.2259290Z Creating deployment parameters.
2020-02-26T12:26:17.2558066Z The detected encoding for file 'd:\a\r1\a\_Azure-Infrastructure\myResourceGroup\deployment\azuredeploy.json' is 'utf-8'
2020-02-26T12:26:17.2561303Z The detected encoding for file 'd:\a\r1\a\_Azure-Infrastructure\myResourceGroup\deployment\param.dev.json' is 'utf-8'
2020-02-26T12:26:17.5304032Z Starting template validation.
2020-02-26T12:26:17.5304834Z Deployment name is Release-vstfs:///ReleaseManagement/Release/95
2020-02-26T12:26:17.5877973Z ##[warning]Validation errors were found in the Azure Resource Manager template. This can potentially cause template deployment to fail. Template validation failed. Error: {"message":"No HTTP resource was found that matches the request URI 'https://management.azure.com/subscriptions/mySubscription/resourcegroups/myResourceGroup/providers/Microsoft.Resources/deployments/Release-vstfs:/ReleaseManagement/Release/95/validate?api-version=2017-05-10'."}.. Please follow https://learn.microsoft.com/en-us/azure/azure-resource-manager/templates/template-syntax
2020-02-26T12:26:17.5890527Z Starting Deployment.
2020-02-26T12:26:17.5891348Z Deployment name is Release-vstfs:///ReleaseManagement/Release/95
2020-02-26T12:26:17.6289831Z There were errors in your deployment. Error code: undefined.
2020-02-26T12:26:17.6291819Z ##[error][object Object]
2020-02-26T12:26:17.6295387Z ##[error]Task failed while creating or updating the template deployment.
2020-02-26T12:26:17.6399260Z ##[section]Finishing: ARM Template deployment: Resource Group scope

​查看上面的日志,我不确定它是否因验证错误而失败,或因接近末尾的错误而失败并出现未定义的错误代码。

该任务来自另一个订阅,它列在该任务的 Azure 资源管理器连接中,并且还列出了该订阅以及订阅中的资源组。

有人对如何使其正常工作或从哪里开始故障排除有任何想法吗?

最佳答案

您的部署名称是:

Release-vstfs:/ReleaseManagement/Release/95

相当肯定这是不允许的 (/)。因此您需要将部署名称设置为合理的名称。

ps。 : 也可能不允许

关于azure - Arm 模板验证通过 Azure Devops 版本失败,可通过 powershell 和 test-AzResourceGroupDeployment 运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60415944/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com