C# Class Tailspin.Surveys.Configuration.KeyVault.KeyVaultConfigurationProvider

Asp.Net configuration provider to read secrets from key vault. This requires List and Get permissions on the vault
Inheritance: Microsoft.Extensions.Configuration.ConfigurationProvider
Datei anzeigen Open project: Azure-Samples/guidance-identity-management-for-multitenant-apps

Public Methods

Method Description
KeyVaultConfigurationProvider ( string appClientId, string vaultName, StoreName storeName, StoreLocation storeLocation, string certificateThumbprint, bool validateCertificate, ILoggerFactory loggerFactory ) : System

Creates the Configuration source to read shared secrets from keyvault using cert in the specified location

KeyVaultConfigurationProvider ( string appClientId, string vaultName, string certificateThumbprint, bool validateCertificate, ILoggerFactory loggerFactory ) : System

Creates the Configuration source to read shared secrets from keyvault using cert in My store of CurrentUser

Load ( ) : void

Loads all secrets which are delimited by : so that they can be retrieved by the config system Since KeyVault does not allow the : character as delimiter in the share secret name is not used as key for configuration, the Tag properties are used instead The tag should always be of the form "ConfigKey"="ParentKey1:Child1:.."

Private Methods

Method Description
GetTokenAsync ( string authority, string resource, string scope ) : Task
LoadAsync ( CancellationToken token ) : Task

Loads all secrets which are delimited by : so that they can be retrieved by the config system Since KeyVault does not allow : as delimiters in the share secret name, the actual name is not used as key for configuration. The Tag property is used instead The tag should always be of the form "ConfigKey"="ParentKey1:Child1:.."

Method Details

KeyVaultConfigurationProvider() public method

Creates the Configuration source to read shared secrets from keyvault using cert in the specified location
public KeyVaultConfigurationProvider ( string appClientId, string vaultName, StoreName storeName, StoreLocation storeLocation, string certificateThumbprint, bool validateCertificate, ILoggerFactory loggerFactory ) : System
appClientId string
vaultName string
storeName StoreName
storeLocation StoreLocation
certificateThumbprint string
validateCertificate bool
loggerFactory ILoggerFactory
return System

KeyVaultConfigurationProvider() public method

Creates the Configuration source to read shared secrets from keyvault using cert in My store of CurrentUser
public KeyVaultConfigurationProvider ( string appClientId, string vaultName, string certificateThumbprint, bool validateCertificate, ILoggerFactory loggerFactory ) : System
appClientId string
vaultName string
certificateThumbprint string
validateCertificate bool
loggerFactory ILoggerFactory
return System

Load() public method

Loads all secrets which are delimited by : so that they can be retrieved by the config system Since KeyVault does not allow the : character as delimiter in the share secret name is not used as key for configuration, the Tag properties are used instead The tag should always be of the form "ConfigKey"="ParentKey1:Child1:.."
public Load ( ) : void
return void