Microsoft.Extensions.Configuration.EnvironmentVariables 11.0.0

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.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
998
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications. When using NuGet 3.x this package requires at least version 3.4.
374
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
55
Microsoft.Extensions.Hosting
.NET Core hosting and startup infrastructures for applications.
39
Microsoft.Identity.Web.TokenAcquisition
Implementation for higher level API for confidential client applications (ASP.NET Core and SDK/.NET).
39
Microsoft.Extensions.Hosting
.NET Core hosting and startup infrastructures for applications.
38
Microsoft.Extensions.Logging.AzureAppServices
Logger implementation to support Azure App Services 'Diagnostics logs' and 'Log stream' features.
36
Microsoft.Extensions.Logging.AzureAppServices
Logger implementation to support Azure App Services 'Diagnostics logs' and 'Log stream' features.
35
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
34
Microsoft.Extensions.Logging.AzureAppServices
Logger implementation to support Azure App Services 'Diagnostics logs' and 'Log stream' features.
34
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/c663adee8e64ba5d379fa0edfb8201984a7df7d0
34
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/e56abc45c4f8adc518abfc11a59849d616431e2c
33
Microsoft.Extensions.Hosting
.NET Core hosting and startup infrastructures for applications.
33
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/d6f154cca3863703cf87c8b840eea9cbe20229b2
33
Microsoft.Extensions.Logging.AzureAppServices
Logger implementation to support Azure App Services 'Diagnostics logs' and 'Log stream' features.
33
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
33
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/5a129191c1a59ef35c9b4c5a04de71ab111c28d2
33
Microsoft.Extensions.Logging.AzureAppServices
Logger implementation to support Azure App Services 'Diagnostics logs' and 'Log stream' features.
32
Microsoft.Extensions.Hosting
.NET Core hosting and startup infrastructures for applications.
32

Version Downloads Last updated
11.0.0 2 11/11/2026
11.0.0-rc.3.26522.148 4 10/30/2026
11.0.0-rc.2.26504.105 4 10/14/2026
11.0.0-rc.1.26425.128 7 09/17/2026
11.0.0-preview.7.26381.103 15 08/12/2026
11.0.0-preview.6.26359.118 13 07/16/2026
11.0.0-preview.5.26302.115 17 06/14/2026
11.0.0-preview.4.26230.115 11 05/14/2026
11.0.0-preview.3.26207.106 18 04/22/2026
11.0.0-preview.2.26159.112 14 03/20/2026
11.0.0-preview.1.26104.118 16 06/23/2026
10.0.15 0 11/10/2026
10.0.14 0 10/25/2026
10.0.13 5 10/14/2026
10.0.12 5 09/11/2026
10.0.11 8 08/15/2026
10.0.10 11 07/16/2026
10.0.9 12 06/24/2026
10.0.8 15 05/14/2026
10.0.7 12 04/22/2026
10.0.6 11 04/22/2026
10.0.5 17 03/20/2026
10.0.4 16 03/20/2026
10.0.3 13 05/15/2026
10.0.2 13 01/31/2026
10.0.1 14 12/31/2025
10.0.0 14 12/06/2025
10.0.0-rc.2.25502.107 14 10/16/2025
10.0.0-rc.1.25451.107 10 09/17/2025
10.0.0-preview.7.25380.108 12 08/19/2025
10.0.0-preview.6.25358.103 10 07/17/2025
10.0.0-preview.5.25277.114 9 06/21/2025
10.0.0-preview.4.25258.110 12 07/21/2025
10.0.0-preview.3.25171.5 19 04/11/2025
10.0.0-preview.2.25163.2 8 06/24/2026
10.0.0-preview.1.25080.5 16 03/01/2025
9.0.23 0 11/10/2026
9.0.22 1 10/30/2026
9.0.21 12 10/14/2026
9.0.20 9 09/12/2026
9.0.19 9 08/15/2026
9.0.18 9 07/16/2026
9.0.17 9 07/06/2026
9.0.16 7 07/06/2026
9.0.15 10 07/06/2026
9.0.14 10 07/06/2026
9.0.13 9 06/24/2026
9.0.12 11 06/27/2026
9.0.11 13 06/24/2026
9.0.10 17 06/24/2026
9.0.9 10 06/22/2026
9.0.8 18 06/22/2026
9.0.7 10 06/22/2026
9.0.6 18 06/22/2026
9.0.5 11 06/03/2025
9.0.4 12 04/11/2025
9.0.3 10 03/16/2025
9.0.2 18 02/14/2025
9.0.1 18 02/02/2025
9.0.0 70 12/12/2024
9.0.0-rc.2.24473.5 10 07/07/2026
9.0.0-rc.1.24431.7 15 09/17/2024
9.0.0-preview.7.24405.7 8 07/06/2026
9.0.0-preview.6.24327.7 11 07/19/2024
9.0.0-preview.5.24306.7 17 06/14/2024
9.0.0-preview.4.24266.19 12 06/01/2024
9.0.0-preview.3.24172.9 8 07/15/2024
9.0.0-preview.2.24128.5 8 07/09/2026
9.0.0-preview.1.24080.9 12 03/05/2024
8.0.0 51 12/15/2023
8.0.0-rc.2.23479.6 17 03/12/2025
8.0.0-rc.1.23419.4 9 01/15/2025
8.0.0-preview.7.23375.6 9 03/04/2024
8.0.0-preview.6.23329.7 16 06/16/2024
8.0.0-preview.5.23280.8 15 09/10/2024
8.0.0-preview.4.23259.5 11 06/20/2024
8.0.0-preview.3.23174.8 11 10/11/2024
8.0.0-preview.2.23128.3 11 05/26/2025
8.0.0-preview.1.23110.8 11 06/23/2026
7.0.0 42 01/08/2024
7.0.0-rc.2.22472.3 14 04/04/2025
7.0.0-rc.1.22426.10 8 06/10/2025
7.0.0-preview.7.22375.6 13 04/26/2024
7.0.0-preview.6.22324.4 10 04/12/2025
7.0.0-preview.5.22301.12 16 04/30/2024
7.0.0-preview.4.22229.4 16 06/13/2024
7.0.0-preview.3.22175.4 11 10/10/2024
7.0.0-preview.2.22152.2 16 12/27/2023
7.0.0-preview.1.22076.8 16 01/18/2024
6.0.2 12 06/22/2026
6.0.2-mauipre.1.22102.15 11 01/01/2024
6.0.2-mauipre.1.22054.8 16 08/08/2024
6.0.1 16 04/17/2022
6.0.0 15 04/17/2022
6.0.0-rc.2.21480.5 10 07/20/2024
6.0.0-rc.1.21451.13 10 02/01/2024
6.0.0-preview.7.21377.19 14 03/12/2024
6.0.0-preview.6.21352.12 9 06/26/2026
6.0.0-preview.5.21301.5 14 06/23/2026
6.0.0-preview.4.21253.7 12 04/27/2024
6.0.0-preview.3.21201.4 10 06/23/2026
6.0.0-preview.2.21154.6 10 07/07/2026
6.0.0-preview.1.21102.12 11 06/23/2026
5.0.0 584 04/18/2022
5.0.0-rc.2.20475.5 12 03/04/2025
5.0.0-rc.1.20451.14 10 12/28/2024
5.0.0-preview.8.20407.11 10 08/03/2024
5.0.0-preview.7.20364.11 14 01/19/2024
5.0.0-preview.6.20305.6 11 03/24/2025
5.0.0-preview.5.20278.1 8 03/10/2024
5.0.0-preview.4.20251.6 9 10/15/2024
5.0.0-preview.3.20215.2 13 04/28/2024
5.0.0-preview.2.20160.3 11 10/10/2024
5.0.0-preview.1.20120.4 14 07/04/2024
3.1.32 18 01/20/2024
3.1.31 11 11/14/2025
3.1.30 17 08/24/2024
3.1.29 12 12/23/2023
3.1.28 14 05/21/2024
3.1.27 17 08/30/2024
3.1.26 15 06/15/2024
3.1.25 10 01/17/2024
3.1.24 13 02/23/2025
3.1.23 15 10/10/2024
3.1.22 20 06/18/2024
3.1.21 19 01/08/2024
3.1.20 12 07/30/2024
3.1.19 11 02/02/2024
3.1.18 13 09/29/2024
3.1.17 19 01/04/2024
3.1.16 16 03/01/2024
3.1.15 13 12/30/2023
3.1.14 16 06/24/2026
3.1.13 9 07/17/2026
3.1.12 19 01/13/2025
3.1.11 11 07/14/2024
3.1.10 12 06/24/2026
3.1.9 15 04/28/2021
3.1.8 18 11/22/2024
3.1.7 13 06/22/2026
3.1.6 29 01/01/2024
3.1.5 16 10/05/2024
3.1.4 13 12/16/2024
3.1.3 17 10/05/2024
3.1.2 17 01/02/2024
3.1.1 10 04/26/2024
3.1.0 11 01/23/2024
3.1.0-preview3.19553.2 16 04/06/2025
3.1.0-preview2.19525.4 13 04/02/2025
3.1.0-preview1.19506.1 13 06/22/2026
3.0.3 17 03/06/2024
3.0.2 15 09/13/2024
3.0.1 16 01/07/2024
3.0.0 15 06/23/2026
3.0.0-rc1.19456.10 13 11/23/2024
3.0.0-preview9.19423.4 12 04/05/2025
3.0.0-preview8.19405.4 17 06/30/2026
3.0.0-preview7.19362.4 10 10/10/2024
3.0.0-preview6.19304.6 12 06/16/2024
3.0.0-preview5.19227.9 8 02/21/2024
3.0.0-preview4.19216.2 9 07/06/2026
3.0.0-preview3.19153.1 17 02/02/2024
3.0.0-preview.19074.2 11 03/14/2024
3.0.0-preview.18572.1 11 07/06/2026
2.2.4 973 02/16/2021
2.2.0 17 12/22/2023
2.2.0-preview3-35497 13 02/06/2025
2.2.0-preview2-35157 16 11/07/2024
2.2.0-preview1-35029 11 10/26/2024
2.1.1 19 09/03/2021
2.1.0 19 11/18/2021
2.1.0-rc1-final 12 09/19/2024
2.1.0-preview2-final 19 02/16/2024
2.1.0-preview1-final 14 02/04/2024
2.0.2 14 01/07/2024
2.0.1 14 06/24/2026
2.0.0 15 06/24/2026
2.0.0-preview2-final 10 02/02/2024
2.0.0-preview1-final 9 06/24/2026
1.1.2 18 05/05/2025
1.1.1 22 01/20/2024
1.1.0 13 07/09/2024
1.1.0-preview1-final 14 05/30/2024
1.0.2 12 06/24/2026
1.0.1 15 03/21/2024
1.0.0 18 06/24/2026
1.0.0-rc2-final 9 09/15/2025
1.0.0-rc1-final 14 08/08/2024