I'd like to know if it is possible to get all Azure Key Vault Secrets by a prefix.
Let's say I have 3 secrets.
key: pre-secret1
value: value1
key: secret2
value: value2
key: pre-secret3
value: value3
I would like to get all secrets with a prefix pre and serialize them to JSON. In the future, I will have more secrets with a prefix so I don't want to read by secret manually. So when I add a new secret with a prefix, my function will return JSON with a new value as well.
The question is: is it possible to get secrets from Azure Key Vault by prefix and serialize dynamically to JSON?
Update: I would like to use it in ASP.NET Core 3.1 and C#. Update2: I added how I can get one secret.
var client = new SecretClient(vaultUri: new Uri(kvUri), credential: new DefaultAzureCredential(true));
var secret = client.GetSecret("secret-name");