我正在使用 ARM 模板部署应用服务计划。该模板昨天有效。部署后,我删除了资源。然后,今天,我尝试使用相同的 ARM 模板重新部署相同的资源,但收到以下错误:
{
"code": "InvalidTemplateDeployment",
"details": [
{
"message": "Object reference not set to an instance of an object."
}
],
"message": "The template deployment 'Microsoft.Template-20220809104848' is not valid according to the validation procedure. The tracking id is 'ae29e10d-8e67-4131-988c-236d65af0f89'. See inner errors for details."
}
我进行了很多搜索,试图理解这条消息“对象引用未设置到对象的实例”的含义,但我找不到任何东西。我尝试从部署日志中下载昨天有效的相同模板,然后再次使用它,但仍然出现此错误。
这是我正在使用的模板:
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.9.1.41621",
"templateHash": "8638675738336979076"
}
},
"resources": [
{
"type": "Microsoft.Web/serverfarms",
"apiVersion": "2020-12-01",
"name": "dfp-testing",
"location": "centralus",
"sku": {
"name": "F1",
"capacity": 1
}
}
]
}
所以,我迷路了。我真的不知道这里发生了什么。
感谢您的帮助。
最佳答案
向您的服务器场资源添加一个空的属性字段,它应该可以解决问题。看起来他们最近将其添加为必填字段。希望这有帮助!
{
"type": "Microsoft.Web/serverfarms",
"apiVersion": "2020-12-01",
"name": "dfp-testing",
"location": "centralus",
"sku": {
"name": "F1",
"capacity": 1
},
"properties": {}
}
关于azure - 将 ARM 模板部署到 Azure 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/73293143/