How to store a secret in Azure Key Vault for your team to retrieve securely

Why

  • You want to store a password, API key, or some other secret in a secure manner that can be accessed by your team as needed. For example, you can store the credentials for test user accounts.

Definitions

An Azure Key Vault is a cloud service that securely stores sensitive information like secrets, encryption keys, and certificates. It helps safeguard access to these resources using fine-grained permissions.

A secret is a piece of data such as a password, connection string, API key, or any other sensitive information. Azure Key Vault can securely store these secrets for your later retrieval.

Instructions

  1. Go to your key vault on Azure

    From the top search bar, you can search for your vault by name, or search for “key vaults” and navigate to your vault. If you need to create a key vault, see How to create an Azure Key Vault.

  2. In the left menu, expand Objects and select Secrets

  3. Click +Generate/Import

  4. Specify the name of your secret

    The name must consist of letters, numbers and dashes (no spaces), and cannot begin with a number.

  5. Specify the secret value

  6. Optionally set a Content Type (typically blank)

    The content type is an optional metadata field that describes the format or purpose of the secret’s value, e.g., "application/json" or "text/plain". You probably don’t need this unless you are a developer. It doesn’t affect how the secret is stored or accessed, but it can help applications interpret the data correctly.

  7. Optionally set an activation date and/or expiration date (typically unset)

    You can optionally set a date when the secret becomes active, and/or set a date when the secret is expired. These dates impact developers who are accessing the secret through API calls. Even if the secret is pre-activation or post-expiration, you can still view its value on the Azure portal.

  8. Optionally disable the secret (typically enabled)

    You can also disable the secret right away. This impacts developers who are accessing the secret through API calls. If the secret is disabled, the API call will not retrieve the value. But even if the secret is disabled, it can still be viewed on the Azure portal.

  9. Click Create

See also

Reference

Leave a Reply