Microsoft.Extensions.Configuration.EnvironmentVariables 10.0.12

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
200
Microsoft.AspNetCore.Hosting
ASP.NET Core hosting infrastructure and startup logic for web applications.
189
Microsoft.AspNetCore.Hosting
ASP.NET Core hosting infrastructure and startup logic for web applications.
174
Microsoft.AspNetCore.Hosting
ASP.NET Core hosting infrastructure and startup logic for web applications.
172
Microsoft.AspNetCore.Hosting
ASP.NET Core hosting infrastructure and startup logic for web applications. This package was built from the source at: https://github.com/aspnet/Hosting/tree/27e4e1aca3863389098b9be6dd9c5b7c030180b8
168
Microsoft.AspNetCore.Hosting
ASP.NET Core hosting infrastructure and startup logic for web applications. This package was built from the source at: https://github.com/aspnet/Hosting/tree/687a99438a1a596a11b7dbd0bf9da5035b3b74eb
167
Microsoft.Identity.Client.Extensions.Msal
This package contains extensions to Microsoft Authentication Library for .NET (MSAL.NET)
167
Microsoft.AspNetCore.Hosting
ASP.NET Core hosting infrastructure and startup logic for web applications.
164
Microsoft.AspNetCore.Hosting
ASP.NET Core hosting infrastructure and startup logic for web applications.
162
Microsoft.AspNetCore.Hosting
ASP.NET Core hosting infrastructure and startup logic for web applications.
160
Microsoft.AspNetCore.Hosting
ASP.NET Core hosting infrastructure and startup logic for web applications.
158
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
157
Microsoft.AspNetCore.Hosting
ASP.NET Core hosting infrastructure and startup logic for web applications.
157
Microsoft.AspNetCore.Hosting
ASP.NET Core hosting infrastructure and startup logic for web applications.
155
Microsoft.Identity.Client.Extensions.Msal
This package contains extensions to Microsoft Authentication Library for .NET (MSAL.NET)
154
Microsoft.AspNetCore.Hosting
ASP.NET Core hosting infrastructure and startup logic for web applications.
154
Microsoft.Identity.Client.Extensions.Msal
This package contains extensions to Microsoft Authentication Library for .NET (MSAL.NET)
152

Version Downloads Last updated
11.0.0-rc.3.26522.148 3 10/27/2026
11.0.0-rc.2.26504.105 7 10/14/2026
11.0.0-rc.1.26425.128 11 9/9/2026
11.0.0-preview.7.26381.103 16 8/13/2026
11.0.0-preview.6.26359.118 24 7/17/2026
11.0.0-preview.5.26302.115 27 6/9/2026
11.0.0-preview.4.26230.115 36 5/13/2026
11.0.0-preview.3.26207.106 33 5/3/2026
11.0.0-preview.2.26159.112 36 3/12/2026
11.0.0-preview.1.26104.118 40 2/12/2026
10.0.14 3 10/27/2026
10.0.13 5 10/14/2026
10.0.12 11 9/9/2026
10.0.11 16 8/13/2026
10.0.10 19 7/16/2026
10.0.9 29 6/10/2026
10.0.8 34 5/13/2026
10.0.7 33 5/4/2026
10.0.6 36 5/4/2026
10.0.5 36 3/14/2026
10.0.4 32 3/12/2026
10.0.3 36 2/12/2026
10.0.2 36 1/15/2026
10.0.1 43 12/11/2025
10.0.0 61 11/11/2025
10.0.0-rc.2.25502.107 75 10/15/2025
10.0.0-rc.1.25451.107 75 9/10/2025
10.0.0-preview.7.25380.108 72 8/14/2025
10.0.0-preview.6.25358.103 96 7/17/2025
10.0.0-preview.5.25277.114 90 6/8/2025
10.0.0-preview.4.25258.110 91 5/15/2025
10.0.0-preview.3.25171.5 107 4/15/2025
10.0.0-preview.2.25163.2 85 3/18/2025
10.0.0-preview.1.25080.5 103 2/26/2025
9.0.22 3 10/27/2026
9.0.21 5 10/14/2026
9.0.20 11 9/10/2026
9.0.19 17 8/13/2026
9.0.18 26 7/18/2026
9.0.17 28 6/10/2026
9.0.16 31 5/13/2026
9.0.15 32 5/3/2026
9.0.14 37 3/12/2026
9.0.13 27 2/12/2026
9.0.12 34 1/16/2026
9.0.11 62 11/11/2025
9.0.10 72 10/15/2025
9.0.9 81 9/10/2025
9.0.8 78 8/5/2025
9.0.7 95 7/12/2025
9.0.6 83 6/12/2025
9.0.5 81 5/16/2025
9.0.4 104 4/9/2025
9.0.3 113 3/17/2025
9.0.2 89 2/15/2025
9.0.1 103 1/18/2025
9.0.0 94 11/18/2024
9.0.0-rc.2.24473.5 117 10/19/2024
9.0.0-rc.1.24431.7 106 9/12/2024
9.0.0-preview.7.24405.7 108 8/14/2024
9.0.0-preview.6.24327.7 116 7/10/2024
9.0.0-preview.5.24306.7 112 6/20/2024
9.0.0-preview.4.24266.19 117 5/26/2024
9.0.0-preview.3.24172.9 99 4/29/2024
9.0.0-preview.2.24128.5 107 3/18/2024
9.0.0-preview.1.24080.9 125 2/23/2024
8.0.0 116 11/17/2023
8.0.0-rc.2.23479.6 115 10/13/2023
8.0.0-rc.1.23419.4 131 9/15/2023
8.0.0-preview.7.23375.6 116 8/22/2023
8.0.0-preview.6.23329.7 112 8/3/2023
8.0.0-preview.5.23280.8 113 7/30/2023
8.0.0-preview.4.23259.5 114 8/3/2023
8.0.0-preview.3.23174.8 123 5/17/2023
8.0.0-preview.2.23128.3 111 5/17/2023
8.0.0-preview.1.23110.8 112 2/24/2023
7.0.0 125 11/17/2022
7.0.0-rc.2.22472.3 129 11/29/2022
7.0.0-rc.1.22426.10 122 9/16/2022
7.0.0-preview.7.22375.6 120 9/16/2022
7.0.0-preview.6.22324.4 124 7/31/2022
7.0.0-preview.5.22301.12 130 6/29/2022
7.0.0-preview.4.22229.4 123 6/30/2022
7.0.0-preview.3.22175.4 124 6/30/2022
7.0.0-preview.2.22152.2 134 6/30/2022
7.0.0-preview.1.22076.8 136 6/30/2022
6.0.2 116 11/17/2024
6.0.2-mauipre.1.22102.15 133 6/30/2022
6.0.2-mauipre.1.22054.8 133 6/30/2022
6.0.1 116 6/30/2022
6.0.0 128 6/30/2022
6.0.0-rc.2.21480.5 131 6/30/2022
6.0.0-rc.1.21451.13 109 6/30/2022
6.0.0-preview.7.21377.19 139 6/30/2022
6.0.0-preview.6.21352.12 116 6/30/2022
6.0.0-preview.5.21301.5 116 6/30/2022
6.0.0-preview.4.21253.7 125 6/30/2022
6.0.0-preview.3.21201.4 119 6/30/2022
6.0.0-preview.2.21154.6 122 6/30/2022
6.0.0-preview.1.21102.12 119 6/30/2022
5.0.0 125 6/30/2022
5.0.0-rc.2.20475.5 126 6/30/2022
5.0.0-rc.1.20451.14 114 6/30/2022
5.0.0-preview.8.20407.11 108 6/30/2022
5.0.0-preview.7.20364.11 123 6/30/2022
5.0.0-preview.6.20305.6 117 6/30/2022
5.0.0-preview.5.20278.1 113 6/30/2022
5.0.0-preview.4.20251.6 129 6/30/2022
5.0.0-preview.3.20215.2 128 6/30/2022
5.0.0-preview.2.20160.3 118 6/30/2022
5.0.0-preview.1.20120.4 125 6/30/2022
3.1.32 119 1/21/2023
3.1.31 121 12/5/2022
3.1.30 119 11/28/2022
3.1.29 130 9/16/2022
3.1.28 130 9/16/2022
3.1.27 126 9/16/2022
3.1.26 131 6/30/2022
3.1.25 117 6/30/2022
3.1.24 135 6/30/2022
3.1.23 124 6/30/2022
3.1.22 127 6/30/2022
3.1.21 125 6/30/2022
3.1.20 117 6/30/2022
3.1.19 119 6/30/2022
3.1.18 129 6/30/2022
3.1.17 120 6/30/2022
3.1.16 135 6/30/2022
3.1.15 118 6/29/2022
3.1.14 128 6/29/2022
3.1.13 129 6/29/2022
3.1.12 125 6/29/2022
3.1.11 130 6/29/2022
3.1.10 131 6/29/2022
3.1.9 124 6/30/2022
3.1.8 135 6/30/2022
3.1.7 120 6/30/2022
3.1.6 129 6/30/2022
3.1.5 121 6/30/2022
3.1.4 121 6/30/2022
3.1.3 126 6/30/2022
3.1.2 123 6/30/2022
3.1.1 121 6/29/2022
3.1.0 126 6/29/2022
3.1.0-preview3.19553.2 123 6/29/2022
3.1.0-preview2.19525.4 115 6/29/2022
3.1.0-preview1.19506.1 130 6/29/2022
3.0.3 135 6/29/2022
3.0.2 119 6/29/2022
3.0.1 133 6/29/2022
3.0.0 132 6/29/2022
3.0.0-rc1.19456.10 130 6/29/2022
3.0.0-preview9.19423.4 121 6/29/2022
3.0.0-preview8.19405.4 125 6/29/2022
3.0.0-preview7.19362.4 122 6/29/2022
3.0.0-preview6.19304.6 118 6/29/2022
3.0.0-preview5.19227.9 104 6/29/2022
3.0.0-preview4.19216.2 124 6/29/2022
3.0.0-preview3.19153.1 119 6/29/2022
3.0.0-preview.19074.2 125 6/29/2022
3.0.0-preview.18572.1 117 6/29/2022
2.2.4 127 6/29/2022
2.2.0 124 6/29/2022
2.2.0-preview3-35497 122 6/29/2022
2.2.0-preview2-35157 129 6/29/2022
2.2.0-preview1-35029 133 6/29/2022
2.1.1 125 6/29/2022
2.1.0 129 6/29/2022
2.1.0-rc1-final 135 6/29/2022
2.1.0-preview2-final 124 6/29/2022
2.1.0-preview1-final 129 6/29/2022
2.0.2 122 6/29/2022
2.0.1 115 6/29/2022
2.0.0 137 6/29/2022
2.0.0-preview2-final 127 6/29/2022
2.0.0-preview1-final 121 6/29/2022
1.1.2 129 6/29/2022
1.1.1 114 6/29/2022
1.1.0 120 6/29/2022
1.1.0-preview1-final 124 6/29/2022
1.0.2 133 6/29/2022
1.0.1 138 6/29/2022
1.0.0 121 6/29/2022
1.0.0-rc2-final 135 6/29/2022
1.0.0-rc1-final 119 6/29/2022