Skip to content
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

Remove FeatureFlag for DisableDevModeInDebug #1955

Closed
brettsam opened this issue Jul 8, 2021 · 2 comments
Closed

Remove FeatureFlag for DisableDevModeInDebug #1955

brettsam opened this issue Jul 8, 2021 · 2 comments

Comments

@brettsam
Copy link
Member

brettsam commented Jul 8, 2021

When in Debug mode, the host used to set the Environment name to "Development ". This meant that files like appsettings.development .json would get picked up when using environment-based JSON config loading. But going into Debug mode seemed arbitrary to a lot of customers -- simply visiting the portal and causing a restart (like disabling a function) would set you in Debug mode, causing the incorrect configuration to be loaded.

With this flag, the Development environment value is never set based on the Functions Debug mode. We want this to be the default in v4

Motivation

Customers have run into hard-to-debug scenarios because of this flag. We'd rather treat the host as always in Production for the sake of consistency.

Impact

Unknown. If needed, we can see if we can gather the number of customers using the JSON configuration source, although the impact may go beyond that as the Environment string is available to any customer from within FunctionsStartup.

Compat-mode support

We could flip and add EnableDevModeInDebug, but we likely shouldn't. This can be set by an App Setting on a staging site (or slot), which makes it much more deterministic.

Alternatives

Setting the environment string in AZURE_FUNCTIONS_ENVIRONMENT as an app setting lets you explicitly control this.

Detection

Since this is a value passed to the FunctionsStartup, I don't know if we can determine how many customers are reading it. If needed, we could log an event in the getter.

Support

Hopefully this reduces support cases; there should be no explicit support education required.

Documentation

AZURE_FUNCTIONS_ENVIRONMENT is already documented (and in fact, the current behavior is incorrect based on documentation): https://docs.microsoft.com/en-us/azure/azure-functions/functions-app-settings#azure_functions_environment.

Components impacted

Host
Core tools already explicitly sets this to "Development": https://github.com/Azure/azure-functions-core-tools/blob/dev/src/Azure.Functions.Cli/Actions/HostActions/StartHostAction.cs#L225-L226

Performance

No perf impact.

@fabiocav
Copy link
Member

fabiocav commented Aug 4, 2021

Assigning this to sprint 107

@brettsam
Copy link
Member Author

brettsam commented Sep 2, 2021

Resolved with Azure/azure-functions-host#7623

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants