How to create a new permission in Key Vault

Miki Ben-Zeev 0 Reputation points Microsoft Employee
2023-01-28T12:09:25.88+00:00

I created a new Vault and added a few key permissions to users to be able to access the secrets in the vault.

However, I am unable to do it anymore. The Vault create button is disabled.

User's image

I do notice there's probably a KeyVault permission I am missing. If that's the case how to I ask for it?

Azure Key Vault
Azure Key Vault
An Azure service that is used to manage and protect cryptographic keys and other secrets used by cloud apps and services.
1,452 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. JIAN WANG 340 Reputation points
    2023-01-28T12:29:26.7466667+00:00

    might be the access policy changed or redefined.

    check the admin who has more access right than yours.

    sepcify if your environment has different subscriptions .


  2. JamesTran-MSFT 36,911 Reputation points Microsoft Employee Moderator
    2023-01-31T00:23:07.78+00:00

    @Miki Ben-Zeev

    Thank you for your post!

    Error Message:

    "Microsoft.KeyVault/vaults/write" permission is required to add or edit access policies.

    From your error message and post it looks like you're trying to create a new Key Vault Access Policy and are running into a permissions issue. I found a similar issue, and if you recently moved your Key Vault to a new Azure tenant, you'll have to update the Tenant ID.

    Update tenant ID in a key vault:

    Select-AzSubscription -SubscriptionId <your-subscriptionId>                # Select your Azure Subscription
    $vaultResourceId = (Get-AzKeyVault -VaultName myvault).ResourceId          # Get your key vault's Resource ID 
    $vault = Get-AzResource -ResourceId $vaultResourceId -ExpandProperties     # Get the properties for your key vault
    $vault.Properties.TenantId = (Get-AzContext).Tenant.TenantId               # Change the Tenant that your key vault resides in
    $vault.Properties.AccessPolicies = @()                                     # Access policies can be updated with real
                                                                               # applications/users/rights so that it does not need to be                             # done after this whole activity. Here we are not setting 
                                                                               # any access policies. 
    Set-AzResource -ResourceId $vaultResourceId -Properties $vault.Properties  # Modifies the key vault's properties.
    
    Clear-AzContext                                                            #Clear the context from PowerShell
    Connect-AzAccount                                                          #Log in again to confirm you have the correct tenant id
    
    • If your Vault isn't in a new Azure tenant, how long after you created the Vault did you run into this permissions issue?
    • Can you share what RBAC role you're assigned to (i.e. Owner or Contributor) when it comes to your Key Vault?

    I hope this helps!

    If you have any other questions, please let me know.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.