Azure Export ARM Template: Microsoft.KeyVault/vaults/accessPolicies cannot be exported yet and is not included in the template

Viewed 491

We are exporting our Azure Key vault to a ARM template. However we get a warning that says:

Microsoft.KeyVault/vaults/accessPolicies cannot be exported yet and is not included in the template. See error details.

enter image description here

Raw Error:

{
  "code": "ExportTemplateCompletedWithErrors",
  "message": "Export template operation completed with errors. Some resources were not exported. Please see details for more information.",
  "details": [
    {
      "code": "ExportTemplateProviderError",
      "target": "Microsoft.KeyVault/vaults/accessPolicies",
      "message": "Could not get resources of the type 'Microsoft.KeyVault/vaults/accessPolicies'. Resources of this type will not be exported."
    }
  ]
}

The weird thing is that in the template there is a complete section of accessPolicies that match our current settings under the tab Access policies. Exactly what is not exported?

enter image description here

2 Answers

Well, I can also reproduce your issue, not sure what caused this.

Per my test, if you click the Download button to export the template, you will find the template is completely correct, including the accessPolicies.

enter image description here

enter image description here

Also, I test to use this exported template to deploy a new keyvault, all work fine, including the accessPolicies.

enter image description here

So if you want to export the template and use it, don't care about the issue, feel free to do that.

Ended up creating a new Key Vault and then used Download a template for automation. No warnings and everything worked as expected.

enter image description here

Related