Skip to content

Need the ability to suppress the environment variable config source #20328

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Tratcher opened this issue Mar 30, 2020 · 1 comment
Closed

Need the ability to suppress the environment variable config source #20328

Tratcher opened this issue Mar 30, 2020 · 1 comment
Assignees
Labels
area-hosting Includes Hosting area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions enhancement This issue represents an ask for new feature or an enhancement to an existing one Needs: Design This issue requires design work before implementating.
Milestone

Comments

@Tratcher
Copy link
Member

#20308

Describe the bug

Blazor's debug proxy runs as a separate process launched from the web app. When running behind IIS out-of-proc it inherits all of the environment variables from IIS/ANCM which causes it to think it is the one responsible for handling requests proxied from IIS. It also ends up with the wrong content root and other such config. Removing ConfigureWebHostDefaults or UseIISIntegration doesn't help because IIS sets the HOSTINGSTARTUPASSEMBLIES environment variable to inject itself (maybe that was a bad idea...).

The debug proxy app needs full control over its configuration and thus needs a way to suppress any config coming from environment variables. That's not possible today because the env var config provider is added by default.

_config = new ConfigurationBuilder()
.AddEnvironmentVariables(prefix: "ASPNETCORE_")
.Build();
_builder.ConfigureHostConfiguration(config =>
{
config.AddConfiguration(_config);

Proposal

Add a way that allows the caller of ConfiureWebHost and/or ConfigureWebHostDefaults to opt out of the environment variable config source.

@Tratcher Tratcher added enhancement This issue represents an ask for new feature or an enhancement to an existing one area-hosting labels Mar 30, 2020
@analogrelay
Copy link
Contributor

(maybe that was a bad idea...)

The character "Chandler Bing" from the TV show "Friends" yells "I knew it" and gestures wildly at a character who is walking off camera.

@analogrelay analogrelay added this to the Next sprint planning milestone Mar 30, 2020
@BrennanConroy BrennanConroy added the Needs: Design This issue requires design work before implementating. label Jul 27, 2020
Tratcher added a commit to Tratcher/aspnetcore that referenced this issue Aug 24, 2020
Tratcher added a commit that referenced this issue Aug 25, 2020
* Allow suppressing the use of environment variables #20328

* Formatting

* Update src/Hosting/Hosting/src/WebHostBuilderOptions.cs

Co-authored-by: Kahbazi <[email protected]>

Co-authored-by: Kahbazi <[email protected]>
@ghost ghost locked as resolved and limited conversation to collaborators Sep 24, 2020
@amcasey amcasey added the area-hosting Includes Hosting label Jun 1, 2023
@amcasey amcasey added area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions and removed area-runtime labels Aug 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-hosting Includes Hosting area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions enhancement This issue represents an ask for new feature or an enhancement to an existing one Needs: Design This issue requires design work before implementating.
Projects
None yet
Development

No branches or pull requests

5 participants