What is the difference between a key and a secret in Azure Key Vault?

Saurabh Sharma 23,676 Reputation points Microsoft Employee
2020-05-06T20:45:03.78+00:00

What is the difference between a key and a secret in Azure Key Vault?

Note: As we migrate from MSDN, this question has been posted by an Azure Cloud Engineer as a frequently asked question

Source: 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,115 questions
Microsoft Entra
0 comments No comments
{count} vote

Accepted answer
  1. Marilee Turscak-MSFT 33,801 Reputation points Microsoft Employee
    2020-05-06T21:43:19.617+00:00

    A secret is anything that you want to tightly control access to, such as API keys, passwords, or certificates.

    A key is a cryptographic key represented as a JSON Web Key [JWK] object. Key Vault supports RSA and Elliptic Curve Keys only.

    Source: Key Vault

    2 people found this answer helpful.
    0 comments No comments

3 additional answers

Sort by: Most helpful
  1. Venkey M 15 Reputation points
    2023-08-10T12:46:48.7633333+00:00

    Example

    Keys:

    let's say you need to encrypt sensitive user data (like SSN) before storing it in your database to ensure confidentiality. You would go for keys in Azure Key Vault. This key would be used to encrypt and decrypt the user data and you NO need to worry about the safety of these keys.

    Secrets:

    Say, your web application needs to connect to an external API that requires an API key for authentication. You would store this API key as a secret in Azure Key Vault, allowing your application to securely retrieve it when making API requests. whenever the vendor changes the key, you can update it in Secrets.

    Hope this helps you.

    3 people found this answer helpful.
    0 comments No comments

  2. José Miguel Lopez Becerra 6 Reputation points
    2021-04-07T09:38:17.783+00:00

    Also one important difference, is that a Key can never leave the Key-Vault boundary. Even the owner of the key vault cannot see or retrieve the clear "key". However, that is not the case with "secrets".

    1 person found this answer helpful.
    0 comments No comments

  3. TSN 0 Reputation points
    2023-05-08T10:49:32.9133333+00:00

    It would be nice if some one can provide an example for Keys and Secrets

    0 comments No comments