DEV Community

Frederick Ollinger
Frederick Ollinger

Posted on

1 1

Azure Key Vaults, SSH Keys, and You

A quick post of how to work with ssh keys using MS azure.

Making a key pair:

ssh-keygen -t rsa
Enter fullscreen mode Exit fullscreen mode

In this example, use the defaults. (Hit ENTER till the key is created.)

You should have a key in:

ls .ssh/id_rsa
Enter fullscreen mode Exit fullscreen mode

Given an Azure Keyvault that you haver previously created, find that vault:

az keyvault list
Enter fullscreen mode Exit fullscreen mode

For this example, let's call it "mykeyvault".

Upload the key.

az keyvault secret set --name sshkey --vault-name mykeyvault --file ~/.ssh/id_rsa
Enter fullscreen mode Exit fullscreen mode

List the keys:

az keyvault secret list --vault-name mykeyvault
Enter fullscreen mode Exit fullscreen mode

Now we can get the key:

az keyvault secret download --name sshkey --vault-name mykeyvault --file sshkey.pem
Enter fullscreen mode Exit fullscreen mode

This should create a file which is the same as ~/.ssh/id_rsa. Prove it with diff.

diff ~/.ssh/id_rsa sshkey.pem
Enter fullscreen mode Exit fullscreen mode

Top comments (0)

Image of Docusign

🛠️ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more