I need to add azure keyvault read access right to the azure app service
resource "azurerm_role_assignment" "this" {
scope = data.azurerm_key_vault.this.id
principal_id = azurerm_linux_web_app.this.identity.0.principal_id
role_definition_name = "Reader" # Seems not correct
}
Where can I find the correct role_definition_name for different resource type for Terraform? I think the role name is different between and Azure Container Registry and Azure Keyvault?
I found the role-based access control roleon this page But can I directly use these role names? for example
role_definition_name = "Key Vault Secrets User"
CodePudding user response:
You van have a look at the Azure build in RBAC roles
It would come down to:
resource "azurerm_role_assignment" "this" {
scope = data.azurerm_key_vault.this.id
role_definition_name = "Key Vault Secrets User"
principal_id = azurerm_linux_web_app.this.identity.0.principal_id
}