I want to get the value of a secret in keyvault in Azure,
I saw that I can create a SecretClient like this: var client = new SecretClient(new Uri(kvUri), new ClientSecretCredential(tenantId, clientId, clientSecret));
how do I know the value to give the constructor? where can I found the clientId, ClientSecret and the kvUri?
Thanks!
You need to create an application for access first when using ClientSecretCredential.
Navigate to Azure Active Directory -> App registrations -> New registration
tenantId
and clientId
are in the "Overview" :
clientSecret
is in "Certificates & secrets":
Note: After creating the application, you must add access policy in key vault for the application.