Azure key vault: access denied

To fix access denied you need to configure Active Directory permissions. Grant access to KeyVault.

1. Using PowerShell
Run next command:

Set-AzureRmKeyVaultAccessPolicy -VaultName 'XXXXXXX' -ServicePrincipalName XXXXX -PermissionsToKeys decrypt,sign,get,unwrapKey

2. Using the Azure portal

  1. Open Key Vaults
  2. Select Access Policies from the Key Vault resource blade
  3. Click the [+ Add Access Policy] button at the top of the blade
  4. Click Select Principal to select the application you created earlier
  5. From the Key permissions drop down, select “Decrypt”, “Sign”, “Get”, “UnwrapKey” permissions
  6. Save changes

Authorize the application to use the key or secret

Leave a Comment