How to add private key in secret of azure key vault to ssh in azure virtual machine using azure bastion

791 Views Asked by At

How to add private key in secret of azure key vault to ssh in azure virtual machine using azure bastion?
I am trying to login a linux virtual machine using bastion and i want to put my .pem file in secret, but i am not able to it right.

1

There are 1 best solutions below

0
On

You can use this answer to add a private key to an Azure Key Vault. How to store a private key in Azure Keyvault?

To summarize, run the following from powershell:

az login
az account set --subscription <subscriptionName>
az keyvault secret set --name <keyName> --vault-name <vaultName> --file <\path\to\key.pem>