what's the maximum length for kv secrets?

Uday Kiran Reddy (ureddy) 96 Reputation points
2024-01-12T08:20:06.17+00:00

In this link, it is mentioned 255 characters length, https://learn.microsoft.com/en-us/azure/key-vault/secrets/about-secrets But when I tested adding dummy text in a secret value, it is taking more than 500 also. Even uploading regular pem files with rsa also takes more than 500 characters. So, what is the exact limit of length? Please specify to the point in number of characters, instead of sharing Kbs size.

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,372 questions
0 comments No comments
{count} votes

Accepted answer
  1. Deepanshu katara 13,840 Reputation points MVP
    2024-01-12T08:57:39.2666667+00:00

    Hi , The length you are mentioning is the length of content type field not for the secret value User's image

    and the maximum character limit for a secret value in Azure Key Vault is 25,600 characters. In the same link you can find that see Below Image User's image Please accept answer if it has helped , Thanks!

    2 people found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Stanislav Zhelyazkov 26,176 Reputation points MVP
    2024-01-12T09:01:22.07+00:00

    Hi, As per the document there it clearly says that you have size limit not character limit. This is also confirmed by Microsoft employee on GitHub. Note the sentence: "Key Vault stores and manages secrets as sequences of octets (8-bit bytes)," so they are not stored as text so there is no character limit thus there is size limit. The character limit of 255 is for contentType field not for the secret value. That field/property is stored as text thus has character limit. I am not mentioning nothing new that is not available on the link you have provided but there is no such information that you are asking due to the nature of how secrets are stored.

    Please "Accept the answer" if the information helped you. This will help us and others in the community as well.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.