ConfigurationProviders
This property enables one or more centralized configuration providers.
Declaration
// C# public static string ConfigurationProviders { get; set; }
Property Type
System.String
Exception
-
ArgumentException: Thrown when
ConfigurationProviders
contains an invalid configuration provider, orNone
is used with another provider, or the string is otherwise not properly formatted. -
ArgumentNullExcpetion: Thrown when
ConfigurationProviders
is set to null
Remarks
This property allows applications to enforce restrictions on which providers can be used.
Table 6-36 ConfigurationProviders Values
Value | Description |
---|---|
|
Enables all configuration providers. This is the default value. |
|
Disables all configuration providers |
|
Enables Azure App configuration provider |
|
Enables Azure Vault Configuration provider |
|
Enables Oracle Cloud Infrastructure (OCI) Configuration provider |
|
Enables OCI Vault Configuration provider |
|
Enable local file provider |
The values are case-insensitive.
These values must be set prior to opening a connection with a centralized configuration provider. They cannot be modified after a connection is opened. The values are not verified until a URL is used upon the connection open.
Any combination of configuration providers can be enabled.
OracleConfiguration.ConfigurationProviders = "File, OCIObject";
Optionally, the list of providers can be enclosed in parentheses. For example, the following code sample enables Azure App configuration provider and OCI Configuration provider.
OracleConfiguration.ConfigurationProviders = "(Azure, OCIObject)";
Duplicate values are ignored, such as (Azure, OCIObject, Azure)
, and do not create an exception.
Using None
in a list with other providers throws an exception, such as (All, None)
or (None, OCIVault)
.
Setting the value to empty parentheses ()
will be the same as using None
. However, using an empty string is invalid, and will result in an error when the value is verified.
Using All
in a list with other providers enables all providers, such as (File, Azure, All)
.
For JSON-based providers, the providers used within the JSON config must also be enabled. For example, if the file provider uses an OCI Vault URL to store the password, both File
and OCIVault
must be enabled.
This setting can also be used in sqlnet.ora or .NET configuration file. The precedence order, from highest to lowest, is:
-
OracleConfiguration.ConfigurationParameters
-
.NET Config
-
sqlnet.ora
Alternatively, instead of using a string value, use the OracleConfigurationProvider
enumeration and bitwise the enums to enable multiple providers. Only OracleConfiguration
ConfigurationProviders
property allows this. Sqlnet.ora
CONFIGURATION_PROVIDERS
and .NET configuration file ConfigurationProviders
do not support using this enumeration. They only support string values. Here is a code sample using ConfigurationProviders
to enable the Azure App Configuration, OCI Object, and Azure Vault providers.
OracleConfiguration.ConfigurationProviders = OracleConfigurationProvider.Azure | OracleConfigurationProvider.OCIObject | OracleConfigurationProvider.AzureVault;