EnvironmentVariablesExtensions.AddEnvironmentVariables Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
AddEnvironmentVariables(IConfigurationBuilder) |
Adds an IConfigurationProvider that reads configuration values from environment variables. |
AddEnvironmentVariables(IConfigurationBuilder, Action<EnvironmentVariablesConfigurationSource>) |
Adds an IConfigurationProvider that reads configuration values from environment variables. |
AddEnvironmentVariables(IConfigurationBuilder, String) |
Adds an IConfigurationProvider that reads configuration values from environment variables with a specified prefix. |
AddEnvironmentVariables(IConfigurationBuilder)
Adds an IConfigurationProvider that reads configuration values from environment variables.
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::Extensions::Configuration::IConfigurationBuilder ^ AddEnvironmentVariables(Microsoft::Extensions::Configuration::IConfigurationBuilder ^ configurationBuilder);
public static Microsoft.Extensions.Configuration.IConfigurationBuilder AddEnvironmentVariables (this Microsoft.Extensions.Configuration.IConfigurationBuilder configurationBuilder);
static member AddEnvironmentVariables : Microsoft.Extensions.Configuration.IConfigurationBuilder -> Microsoft.Extensions.Configuration.IConfigurationBuilder
<Extension()>
Public Function AddEnvironmentVariables (configurationBuilder As IConfigurationBuilder) As IConfigurationBuilder
Parameters
- configurationBuilder
- IConfigurationBuilder
The IConfigurationBuilder to add to.
Returns
Applies to
AddEnvironmentVariables(IConfigurationBuilder, Action<EnvironmentVariablesConfigurationSource>)
Adds an IConfigurationProvider that reads configuration values from environment variables.
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::Extensions::Configuration::IConfigurationBuilder ^ AddEnvironmentVariables(Microsoft::Extensions::Configuration::IConfigurationBuilder ^ builder, Action<Microsoft::Extensions::Configuration::EnvironmentVariables::EnvironmentVariablesConfigurationSource ^> ^ configureSource);
public static Microsoft.Extensions.Configuration.IConfigurationBuilder AddEnvironmentVariables (this Microsoft.Extensions.Configuration.IConfigurationBuilder builder, Action<Microsoft.Extensions.Configuration.EnvironmentVariables.EnvironmentVariablesConfigurationSource>? configureSource);
static member AddEnvironmentVariables : Microsoft.Extensions.Configuration.IConfigurationBuilder * Action<Microsoft.Extensions.Configuration.EnvironmentVariables.EnvironmentVariablesConfigurationSource> -> Microsoft.Extensions.Configuration.IConfigurationBuilder
<Extension()>
Public Function AddEnvironmentVariables (builder As IConfigurationBuilder, configureSource As Action(Of EnvironmentVariablesConfigurationSource)) As IConfigurationBuilder
Parameters
- builder
- IConfigurationBuilder
The IConfigurationBuilder to add to.
- configureSource
- Action<EnvironmentVariablesConfigurationSource>
The action that configures the source.
Returns
Applies to
AddEnvironmentVariables(IConfigurationBuilder, String)
Adds an IConfigurationProvider that reads configuration values from environment variables with a specified prefix.
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::Extensions::Configuration::IConfigurationBuilder ^ AddEnvironmentVariables(Microsoft::Extensions::Configuration::IConfigurationBuilder ^ configurationBuilder, System::String ^ prefix);
public static Microsoft.Extensions.Configuration.IConfigurationBuilder AddEnvironmentVariables (this Microsoft.Extensions.Configuration.IConfigurationBuilder configurationBuilder, string? prefix);
static member AddEnvironmentVariables : Microsoft.Extensions.Configuration.IConfigurationBuilder * string -> Microsoft.Extensions.Configuration.IConfigurationBuilder
<Extension()>
Public Function AddEnvironmentVariables (configurationBuilder As IConfigurationBuilder, prefix As String) As IConfigurationBuilder
Parameters
- configurationBuilder
- IConfigurationBuilder
The IConfigurationBuilder to add to.
- prefix
- String
The prefix that environment variable names must start with. The prefix will be removed from the environment variable names.
Returns
Applies to
.NET