Microsoft.Extensions.Configuration.EnvironmentVariables 9.0.2

About

Environment variables configuration provider implementation for Microsoft.Extensions.Configuration. This package enables you to read configuration parameters from environment variables. You can use EnvironmentVariablesExtensions.AddEnvironmentVariables extension method on IConfigurationBuilder to add the environment variables configuration provider to the configuration builder.

How to Use

The following example shows how to read application configuration from environment variables.

using System;
using Microsoft.Extensions.Configuration;

class Program
{
    static void Main()
    {
        // Build a configuration object from environment variables
        IConfiguration config = new ConfigurationBuilder()
            .AddEnvironmentVariables()
            .Build();
        
        // Read configuration values
        Console.WriteLine($"Server: {config["Server"]}");
        Console.WriteLine($"Database: {config["Database"]}");
    }
}

Additional Documentation

Feedback & Contributing

Microsoft.Extensions.Configuration.EnvironmentVariables is released as open source under the MIT license. Bug reports and contributions are welcome at the GitHub repository.

Showing the top 20 packages that depend on Microsoft.Extensions.Configuration.EnvironmentVariables.

Packages Downloads
Microsoft.AspNetCore.AzureAppServices.HostingStartup
ASP.NET Core lightup integration with Azure AppServices. This package was built from the source code at https://github.com/dotnet/aspnetcore/tree/d47e49e9c1e173ac90821f7e89cc38e710274241
19
Microsoft.AspNetCore.Hosting
ASP.NET Core hosting infrastructure and startup logic for web applications.
16
Microsoft.AspNetCore.Hosting
ASP.NET Core hosting infrastructure and startup logic for web applications.
17
Microsoft.AspNetCore.Hosting
ASP.NET Core hosting infrastructure and startup logic for web applications.
18
Microsoft.AspNetCore.Hosting
ASP.NET Core hosting infrastructure and startup logic for web applications.
30
Microsoft.AspNetCore.Hosting
ASP.NET Core hosting infrastructure and startup logic for web applications. This package was built from the source code at https://github.com/aspnet/AspNetCore/tree/be0a4a7f4cf06cbd6ec714bd1d9afee6bdb040a8
35
Microsoft.AspNetCore.Hosting
ASP.NET Core hosting infrastructure and startup logic for web applications. This package was built from the source code at https://github.com/aspnet/Hosting/tree/0724e6cde1149ee1a19bfec9c13a2c9327b71213
22
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
17
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
20
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
23
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
155
Microsoft.Extensions.Hosting
.NET Core hosting and startup infrastructures for applications.
22
Microsoft.Extensions.Hosting
.NET Core hosting and startup infrastructures for applications.
5,336
Microsoft.Extensions.Hosting
.NET Core hosting and startup infrastructures for applications.
8,827
Microsoft.Extensions.Logging.AzureAppServices
Logger implementation to support Azure App Services 'Diagnostics logs' and 'Log stream' features. This package was built from the source code at https://github.com/dotnet/aspnetcore/tree/1d696053fcd6735aaac1902afdb0b92edbf43e71
16
Microsoft.Extensions.Logging.AzureAppServices
Logger implementation to support Azure App Services 'Diagnostics logs' and 'Log stream' features. This package was built from the source code at https://github.com/dotnet/aspnetcore/tree/36be7ed6d6d56b7da0a2891e3de7ecc2aa48eecd
17
Microsoft.Extensions.Logging.AzureAppServices
Logger implementation to support Azure App Services 'Diagnostics logs' and 'Log stream' features. This package was built from the source code at https://github.com/dotnet/aspnetcore/tree/7c810658463f35c39c54d5fb8a8dbbfd463bf747
19

https://go.microsoft.com/fwlink/?LinkID=799421

Version Downloads Last updated
9.0.2 1 02/22/2025
9.0.1 1 02/02/2025
9.0.0 9 11/14/2024
9.0.0-rc.2.24473.5 5 11/25/2024
9.0.0-rc.1.24431.7 5 11/26/2024
9.0.0-preview.7.24405.7 5 11/14/2024
9.0.0-preview.6.24327.7 5 11/26/2024
9.0.0-preview.5.24306.7 1 01/07/2025
9.0.0-preview.4.24266.19 8 11/14/2024
9.0.0-preview.3.24172.9 13 05/16/2024
9.0.0-preview.2.24128.5 11 05/05/2024
9.0.0-preview.1.24080.9 13 05/02/2024
8.0.0 185 02/04/2024
8.0.0-rc.2.23479.6 15 05/14/2024
8.0.0-rc.1.23419.4 5 11/23/2024
8.0.0-preview.7.23375.6 6 12/08/2024
8.0.0-preview.6.23329.7 24 08/08/2023
8.0.0-preview.5.23280.8 6 11/12/2024
8.0.0-preview.4.23259.5 5 11/27/2024
8.0.0-preview.3.23174.8 5 11/26/2024
8.0.0-preview.2.23128.3 10 05/06/2024
8.0.0-preview.1.23110.8 9 05/19/2024
7.0.0 24 02/02/2023
7.0.0-rc.2.22472.3 5 11/27/2024
7.0.0-rc.1.22426.10 6 11/27/2024
7.0.0-preview.7.22375.6 5 11/27/2024
7.0.0-preview.6.22324.4 6 11/28/2024
7.0.0-preview.5.22301.12 5 11/27/2024
7.0.0-preview.4.22229.4 7 11/27/2024
7.0.0-preview.3.22175.4 11 05/06/2024
7.0.0-preview.1.22076.8 10 05/02/2024
6.0.2 6 11/14/2024
6.0.1 11 09/07/2022
6.0.0 19 05/09/2022
6.0.0-rc.2.21480.5 4 11/26/2024
6.0.0-rc.1.21451.13 5 11/27/2024
6.0.0-preview.7.21377.19 10 05/08/2024
6.0.0-preview.6.21352.12 2 01/07/2025
6.0.0-preview.5.21301.5 17 05/17/2024
6.0.0-preview.2.21154.6 8 05/02/2024
6.0.0-preview.1.21102.12 7 11/29/2024
5.0.0-rc.2.20475.5 12 05/25/2024
5.0.0-rc.1.20451.14 13 05/01/2024
5.0.0-preview.7.20364.11 6 12/02/2024
5.0.0-preview.5.20278.1 8 11/26/2024
5.0.0-preview.4.20251.6 5 11/26/2024
5.0.0-preview.3.20215.2 13 05/09/2024
5.0.0-preview.2.20160.3 11 05/10/2024
5.0.0-preview.1.20120.4 12 05/03/2024
3.1.32 8,951 05/11/2023
3.1.31 17 05/24/2024
3.1.30 5,404 11/03/2022
3.1.29 12 05/07/2024
3.1.28 11 05/03/2024
3.1.27 10 05/17/2024
3.1.26 7 11/30/2024
3.1.25 8 11/12/2024
3.1.18 13 05/10/2022
3.1.15 7 11/27/2024
3.1.14 10 05/09/2022
3.1.10 14 05/02/2024
3.1.7 5 12/05/2024
3.1.4 7 11/27/2024
3.1.0-preview3.19553.2 10 05/02/2024
3.1.0-preview1.19506.1 7 11/11/2024
3.0.0-rc1.19456.10 7 11/12/2024
3.0.0-preview7.19362.4 7 12/07/2024
3.0.0-preview6.19304.6 15 05/10/2022
3.0.0-preview5.19227.9 5 12/02/2024
3.0.0-preview3.19153.1 9 12/06/2024
3.0.0-preview.18572.1 4 11/27/2024
2.2.0-preview3-35497 5 12/02/2024
2.2.0-preview2-35157 6 11/27/2024
2.2.0-preview1-35029 12 05/05/2024
2.1.1 11 05/17/2024
2.1.0-rc1-final 9 11/14/2024
2.1.0-preview2-final 15 05/22/2024
2.1.0-preview1-final 6 11/27/2024
2.0.0-preview1-final 10 05/17/2024
1.1.1 10 05/27/2024
1.1.0-preview1-final 8 05/15/2024
1.0.2 6 12/03/2024
1.0.0 13 05/26/2024
1.0.0-rc2-final 6 11/28/2024
1.0.0-rc1-final 6 11/27/2024