1
votes

Trying to deploy an Azure Key Vault but keeping some form of Infrastructure as Code, unfortunately from what I've been able to find the only way you can utilize the --no-self-perms property is with the usage of Azure CLI

https://docs.microsoft.com/en-us/cli/azure/keyvault?view=azure-cli-latest

Is there any simple way that I can still use --no-self-perms property in an ARM template? Even better is there a simple way to use it with terraform (not currently available as a property)

1
have you tried deploy it via ARM template and leaving the accessPolices field empty? github.com/Azure/azure-quickstart-templates/blob/master/…silent

1 Answers

0
votes

After my validation, you just need to set the accessPolices field like "accessPolicies": [], in your ARM template, then the result will be the same as that you use --no-self-perms property in Azure CLI az keyvault create --location $location --name $MyKeyVault --resource-group $MyResourceGroup --no-self-perms.

If you want to use it with terraform. You could use azurerm_template_deployment to invoke your template with terraform or use local-exec Provisioner under resource "null_resource" to execute Azure CLI commands locally.