You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
var kv = new KeyVaultClient(new KeyVaultClient.AuthenticationCallback(GetToken));
configBuilder.AddAzureKeyVault(options.BaseUrl, kv, new DefaultKeyVaultSecretManager());
public static async Task<string> GetToken(string authority, string resource, string scope)
{
var options = Configuration.Bind<AzureVaultOptions>("AzureVault");
var authContext = new AuthenticationContext(authority);
ClientCredential clientCred = new ClientCredential(options.ClientId, options.ClientSecret);
AuthenticationResult result = await authContext.AcquireTokenAsync(resource, clientCred);
if (result == null)
throw new InvalidOperationException("Failed to obtain the JWT token");
return result.AccessToken;
}
Add Azure Vault Key Configuration provider that can be used with MSI and without MSI token provider.
-How to use managed identities for App Service and Azure Functions
-Add method to get an access token
-Using Azure KeyVault to manage secrets of eShopOnContainers
-Connection String Support
Everything can be done thru:
This what the alternative code would look like:
Issue of using outside of MSI
Get access token using Microsoft.Azure.Services.AppAuthentication in a container
The text was updated successfully, but these errors were encountered: