Azure ARM模板-冲突更新

Azure ARM模板-冲突更新,azure,azure-cognitive-search,arm-template,Azure,Azure Cognitive Search,Arm Template,有一个ARM模板用于提供两个Azure搜索服务 "resources": [ { "type": "Microsoft.Search/searchServices", "name": "[parameters('serviceName')]", "apiVersion": "[parameters('serviceApiVersion')]", "location": "[parameters('location')]", "properties": { "sku":

有一个ARM模板用于提供两个Azure搜索服务

"resources": [
{
  "type": "Microsoft.Search/searchServices",
  "name": "[parameters('serviceName')]",
  "apiVersion": "[parameters('serviceApiVersion')]",
  "location": "[parameters('location')]",
  "properties": {
    "sku": {
      "name": "[parameters('sku')]"
    },
    "replicaCount": 1,
    "partitionCount": 1,
    "hostingMode": "[parameters('hostingMode')]"
  }
},
{
  "type": "Microsoft.Search/searchServices",
  "name": "[concat(parameters('serviceName'), 'secondary')]",
  "apiVersion": "[parameters('serviceApiVersion')]",
  "location": "[parameters('location')]",
  "properties": {
    "sku": {
      "name": "[parameters('sku')]"
    },
    "replicaCount": 1,
    "partitionCount": 1,
    "hostingMode": "[parameters('hostingMode')]"
  }
}]
ARM模板部署提供一个搜索服务,另一个搜索服务失败,响应:

{
  "error": {
    "code": "Unknown",
    "message": "There was a conflicting update. No change was made to the resource from this request. RequestId: b65a51b5-cd87-4dc5-82d9-9041ddd1c2dc",
    "target": null,
    "details": null
  }
}

有人面临这样的问题吗?

也许搜索服务不能在同一资源组中同时配置。尝试向第二个搜索服务添加“dependsOn”属性。

可能无法在同一资源组中同时设置搜索服务。尝试将“dependsOn”属性添加到第二个搜索服务。

问题 搜索服务不依赖其他服务,因此不需要
dependsOn
属性
我认为问题在于您的arm语法无效

我不知道您使用的是哪个apiVersion,但我找不到任何具有相同语法的apiVersion。。。 (最类似于2015-02-28,但此处不允许使用
hostingMode
字段)

解决方案 使用不带主机模式的apiVersion 2015-02-28或(如果需要该字段)使用更新的apiVersion,其中“sku”位于“属性”之外。以下是我的作品

{
  "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
  "contentVersion": "1.0.0.0",
  "resources": [
  {
    "type": "Microsoft.Search/searchServices",
    "name": "parameters('serviceName')",
    "apiVersion": "2015-08-19",
    "location": "parameters('location')",
    "properties": {
      "replicaCount": 1,
      "partitionCount": 1,
      "hostingMode": "default"
    },
    "sku": {
      "name": "basic"
    }
  },
  {
    "type": "Microsoft.Search/searchServices",
    "name": "[concat(parameters('serviceName'), 'secondary')]"
    "apiVersion": "2015-08-19",
    "location": "parameters('location')",
    "properties": {
      "replicaCount": 1,
      "partitionCount": 1,
      "hostingMode": "default"
    },
    "sku": {
      "name": "basic"
    }
  }]
}

问题 搜索服务不依赖其他服务,因此不需要
dependsOn
属性
我认为问题在于您的arm语法无效

我不知道您使用的是哪个apiVersion,但我找不到任何具有相同语法的apiVersion。。。 (最类似于2015-02-28,但此处不允许使用
hostingMode
字段)

解决方案 使用不带主机模式的apiVersion 2015-02-28或(如果需要该字段)使用更新的apiVersion,其中“sku”位于“属性”之外。以下是我的作品

{
  "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
  "contentVersion": "1.0.0.0",
  "resources": [
  {
    "type": "Microsoft.Search/searchServices",
    "name": "parameters('serviceName')",
    "apiVersion": "2015-08-19",
    "location": "parameters('location')",
    "properties": {
      "replicaCount": 1,
      "partitionCount": 1,
      "hostingMode": "default"
    },
    "sku": {
      "name": "basic"
    }
  },
  {
    "type": "Microsoft.Search/searchServices",
    "name": "[concat(parameters('serviceName'), 'secondary')]"
    "apiVersion": "2015-08-19",
    "location": "parameters('location')",
    "properties": {
      "replicaCount": 1,
      "partitionCount": 1,
      "hostingMode": "default"
    },
    "sku": {
      "name": "basic"
    }
  }]
}


您使用什么进程来运行部署?Azure客户端、powershell、Azure门户?在资源组中,检查部署刀片服务器,查看是否已在运行部署正在使用哪个进程来运行部署?Azure客户端、powershell、Azure门户?在资源组中,检查部署刀片服务器,查看是否已在运行部署