Generate GPG (PGP) key pair in Azure and store in Azure Key Vault

Gupta, Rajesh 81 Reputation points

Is there an easy way to generate GPG (PGP) key pair in Azure and store in Azure Key Vault?

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

Accepted answer
  1. JamesTran-MSFT 36,541 Reputation points Microsoft Employee

    @Gupta, Rajesh
    Thank you for your post and I apologize for the delayed response!

    I'm not too familiar with PGP keys, but I did find some information on this which I'll share below.

    PGP KEY process:

    1. Use PGP key tool to create PGP key pair with passphrase
    2. Export from PGP key tool, the PGP public Key and PGP Private Key as text files (.asc)
    3. Use Powershell to BASE 64 files: PGP public key, PGP Private Key, and PassPhrase
    4. Import BASE 64 files in to Azure Key Vault Secrets via Azure Portal or Powershell

    If this is the current process you're referring to when creating PGP keys and storing them in the Azure Key Vault, the Key type (.asc) currently isn't supported by the Key Vault. For more info. If this isn't the process you're using, can share some documentation or examples so I can gain a better understanding of your issue.

    About keys

    If you have any other questions, please let me know.
    Thank you for your time and patience throughout this issue.

    Please remember to "Accept Answer" if any answer/reply helped, so that others in the community facing similar issues can easily find the solution.

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Scott Stauffer - Flight Centre 31 Reputation points

    Hello @Gupta, Rajesh

    I discovered that there IS a way to do this.
    I might do a quick YouTube video on this, BUT, for now...
    You can click on the Cloud Shell button in the top banner row of the Azure Key Vault (or anywhere in the Azure Portal for that matter!)
    The Cloud Shell icon looks like the PowerShell Icon.
    The Cloud Shell allows you to run both BASH and PowerShell Commands. If it is your first time using the Cloud Shell, it may ask you to create some storage for the purposes of creating files in.


    3 people found this answer helpful.