How to debug a ConflictError when adding an access policy to a key vault using an ARM deployment
I had the same error, I guess that it is because you are trying to modify the same item "key vault" in parallel. This change fixed my problem:
"mode": "serial"
"copy": {
"name": "<name-of-loop>",
"count": <number-of-iterations>,
"mode": "serial" <or> "parallel"
}
During deployment, you can request that additional information is logged during a deployment. In powershell, set the DeploymentDebugLogLevel
parameter to All.
New-AzResourceGroupDeployment `
-Name exampledeployment `
-ResourceGroupName examplegroup `
-TemplateFile c:\Azure\Templates\storage.json `
-DeploymentDebugLogLevel All
Then you can examine the request content or the response content.
(Get-AzResourceGroupDeploymentOperation `
-DeploymentName exampledeployment `
-ResourceGroupName examplegroup).Properties.response `
| ConvertTo-Json
For more details regarding troubleshoot deployment errors, you can refer to https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-manager-common-deployment-errors