Quickstart: Set and retrieve a key from Azure Key Vault using the Azure portal

Azure Key Vault is a cloud service that provides a secure store for secrets. You can securely store keys, passwords, certificates, and other secrets. Azure key vaults may be created and managed through the Azure portal. In this quickstart, you create a key vault, then use it to store a key. For more information on Key Vault, review the Overview.

Prerequisites

To access Azure Key Vault, you'll need an Azure subscription. If you don't already have a subscription, create a free account before you begin.

All access to secrets takes place through Azure Key Vault. For this quickstart, create a key vault using the Azure portal, Azure CLI, or Azure PowerShell.

Sign in to Azure

Sign in to the Azure portal.

Add a key to Key Vault

To add a key to the vault, you just need to take a couple of additional steps. In this case, we add a key that could be used by an application. The key is called ExampleKey.

  1. On the Key Vault properties pages, select Keys.
  2. Select Generate/Import.
  3. On the Create a key screen choose the following values:
    • Options: Generate.
    • Name: ExampleKey.
    • Leave the other values to their defaults. Select Create.

Retrieve a key from Key Vault

Once that you receive the message that the key has been successfully created, you may click on it on the list. You can then see some of the properties and select Download public key to retrieve the key.

Key properties

Clean up resources

Other Key Vault quickstarts and tutorials build upon this quickstart. If you plan to continue on to work with subsequent quickstarts and tutorials, you may wish to leave these resources in place. When no longer needed, delete the resource group, which deletes the Key Vault and related resources. To delete the resource group through the portal:

  1. Enter the name of your resource group in the Search box at the top of the portal. When you see the resource group used in this quickstart in the search results, select it.
  2. Select Delete resource group.
  3. In the TYPE THE RESOURCE GROUP NAME: box type in the name of the resource group and select Delete.

Next steps

In this quickstart, you created a Key Vault and stored a key in it. To learn more about Key Vault and how to integrate it with your applications, continue on to these articles.