Click or drag to resize

KeyVaultSecretProvider Class

Retrieves secrets from Azure Key Vault, failing over to ordinary configuration if not found.
Inheritance Hierarchy
SystemObject
  InnerDrive.AzureKeyVaultSecretProvider

Namespace: InnerDrive.Azure
Assembly: InnerDrive.Azure (in InnerDrive.Azure.dll) Version: 5.0.8475.0
Syntax
C#
public class KeyVaultSecretProvider : ISecretProvider

The KeyVaultSecretProvider type exposes the following members.

Constructors
 NameDescription
Public methodKeyVaultSecretProvider Creates a new instance of KeyVaultSecretProvider
Top
Properties
 NameDescription
Public propertyConfiguration Gets the IConfiguration provider used by this class.
Public propertyItemGets or sets a secret configuration value
Public propertyKeyVaultTenantId Gets the Azure tenant ID to use connecting to the Azure Key Vault identified by KeyVaultUrl
Public propertyKeyVaultUrl Allows classes to get configuration settings from secrets providers, such as Azure Key Vault.
Public propertyThrowOnFailure Allows classes to get configuration settings from secrets providers, such as Azure Key Vault.
Public propertyTraceKeyVaultActivity If true, turns on tracing in the DefaultAzureCredentialOptions used to connect to Azure Key Vault.
Top
Methods
 NameDescription
Public methodEqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
Public methodGetHashCodeServes as the default hash function.
(Inherited from Object)
Public methodGetSecretAsyncGets a secret configuration value
Public methodGetTypeGets the Type of the current instance.
(Inherited from Object)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
Public methodSetSecretAsyncGets a secret configuration value
Public methodToStringReturns a string that represents the current object.
(Inherited from Object)
Top
Fields
 NameDescription
Public fieldStatic memberCacheExpirationSetting The Configuration setting containing the length of time in seconds to hold a secret in the internal cache
Public fieldStatic memberDefaultCacheExpirationSeconds The length of time in seconds to hold a secret in the internal cache if CacheExpirationSetting is not set
Public fieldStatic memberKeyVaultTenantIdSettingName Gets the name of the Azure Key Vault Tenant ID setting in appSettings.config
Public fieldStatic memberKeyVaultUrlSettingName Gets the name of the Azure Key Vault URL setting in appSettings.config
Public fieldStatic memberThrowExceptionsSettingName The name of the appSettings.config setting that, if true, will cause the KeyVaultSecretProvider to throw exceptions instead of failing silently.
Public fieldStatic memberTraceKeyVaultSettingName The name of the appSettings.config setting that, if true, will turn on tracing in the DefaultAzureCredentialOptions used to connect to Azure Key Vault.
Top
Remarks
The KeyVaultSecretProvider expects the following settings:
SettingPurpose
keyVaultTenantIdThe Azure tenant ID to use by default
keyVaultUrlThe Azure Key Vault URL to use by default
keyVaultSecretProviderThrowExceptionsIf true, the class will throw exceptions on all failures. Default is false. Use only for debugging.
keyVaultSecretProviderTraceIf true, this will turn on native Key Vault tracing. Default is false.
See Also