Hi @Jonathan Lafleur,
Based on your query, here is the summary:
As per the review, you have used the action Microsoft.KeyVault/vaults/secrets/set/action, which triggered an (InvalidActionOrNotAction) error, as the specified action is not supported in Azure’s RBAC model. Explained that access to Key Vault secrets must be configured using DataActions
and NotDataActions
, since these operations are considered data-plane. Provided a corrected custom role definition that includes DataAction
s for writing, listing, and reading metadata of secrets, while explicitly excluding secret read access via NotDataActions
. Official Microsoft documentation to support the guidance: https://learn.microsoft.com/en-us/azure/key-vault/general/rbac-guide?tabs=azure-cli.Kindly use the below Json file as an example to rephrase your Json file which mostly resolves the issue:
az role definition create --role-definition '{ "Name": "Backup Keys Operator", "Description": "Perform key backup/restore operations", "Actions": [
], "DataActions": [ "Microsoft.KeyVault/vaults/keys/read ", "Microsoft.KeyVault/vaults/keys/backup/action", "Microsoft.KeyVault/vaults/keys/restore/action" ], "NotDataActions": [
], "AssignableScopes": ["/subscriptions/{subscriptionId}"] }'
I hope this information is helpful. Please feel free to reach out if you have any further questions.
If the answer is helpful, please click "Accept Answer" and kindly "upvote it". If you have extra questions about this answer, please click "Comment".