We are facing an issue while setting the permission for a backup management service(262044b1-e2ce-469f-a196-69ab7ada62d3) in the key vault.
We are running the below code in a automation account with a service principal which do not have permission to Windows Azure Directory and Microsoft graph.
Set-AzureRmKeyVaultAccessPolicy -VaultName MAHSEN-KEY-00010-DEV -ResourceGroupName MAHSBC-RGP-DEV-ARM-TEMPLATE-008 -AzureRmContext $context -PermissionsToSecrets backup,get,list -ServicePrincipalName 262044b1-e2ce-469f-a196-69ab7ada62d3
We get the error “Insufficient privileges to complete the operation”.
When, we run the same code where the automation account has permission to the Windows Azure Active Directory with “Read directory data” permissions, we are able to run the commands successfully as shown below in the screen shots.
Can you please confirm, if the Windows Azure Active Directory permissions are required to use Set-AzureRmKeyVaultAccessPolicy
command?