How to make an integration between azure pipeline and azure key vault?

NSRD (Simon Prisholm Skrøder) 0 Reputation points
2023-11-16T09:47:11.41+00:00

I get this error when I try to make a integration between a pipeline and azure key vault:

Failed to create an app in azure active directory. error: insufficient privileges to complete the operation in Microsoft graph ensure that the user has permissions to create an azure active directory application.

What should I do?

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,448 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Luis Arias 8,621 Reputation points Volunteer Moderator
    2023-11-16T12:11:34.27+00:00

    Hi Simon,

    You can test your access to the secret by az cli before use in pipeline :
    Using a personal account:

    az keyvault secret show --name "<Your Secret Name>" --vault-name "<Your Key Vault Name>" --query value --output tsv
    

    Using Service principal:

    #Login with your Service principal
    az login --service-principal -u <app-url> -p <password-or-cert> --tenant <tenant>
    
    az keyvault secret show --name "<Your Secret Name>" --vault-name "<Your Key Vault Name>" --query value --output tsv
    

    Let me know your output. if there is a problem with rbac permission you can add your user to Key Vault Administrator role , Please note that the Key Vault Administrator role only works for key vaults that use the ‘Azure role-based access control’ permission model.

    https://learn.microsoft.com/en-us/azure/key-vault/general/rbac-guide?tabs=azure-cli

    Cheers,

    Luis


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.