misleading warning message (local.host.settings) : Skipping 'xxx' from local settings as it's already defined in current environment variables
I have a setting value in local.host.settings which has an empty string value: "xxx":""
Once I start the function I will get an : Skipping 'xxx' from local settings as it's already defined in current environment variables
which is misleading
I am not sure what part of the message you are referring to as misleading. The message basically mentions that the function runtime is going to use the value of the setting from the environment variables instead of the one defined in your local settings. Can you elaborate a bit more on what is misleading?
Is this value exist in the environment variable? that is confusion! the message should give more details indication that local settings is missing a real value. Other note: what is wrong with putting a setting's value as an empty string?
- You would get this warning when there is a setting
xxxpresent inlocal.settings.json. The same settingxxxis present on your computer as an environment variable. So when you start functions CLI it sees that it can get the value forxxxfrom 2 places. The message simply states that it is going to use the value of the setting from your computer's environment variable. - The actual value of
xxxin local.settings.json or you computers environment variable has no effect on the cause of this warning. You would get this warning even ifxxxhad an actual value in thelocal.settings.jsonfile and is not an empty string. - Adding a warning that a property in
local.setting.jsonis missing a value could be noisy since the property may not be used by any of the function app or may be empty on purpose as you suggested. - There is nothing wrong with having empty value for a setting. The message does not have co-relation to the empty value in the local.settings.json.
Hope this provides some clarity to the cause of warning message. However i am open to suggestions for a clearer message. Do you have a recommendation?
@soninaren You get this warning when the setting in local.settings.json is empty and the environment variable does not exist. This means you can't rely on empty strings in local.settings.json as the result will be null. I believe this is a bug, or at least you should change the warning message to say that empty settings will be ignored/return null.
You also get this warning when a variable is NOT set in my computer's environment, NOT set in my local.settings.json (not even to an empty string) but ONLY set in my launchSettings.json. In my case I get warnings on the AZURE_FUNCTIONS_ENVIRONMENT variable. I thought that this was maybe due to the fact that it defaults to the value "Development", but I get the same warning when I set it to "Staging" in my launchSettings.json. In that case I have no idea which value is used. That is confusing to say the least.
When I set a breakpoint in my FunctionsStartup.Configure(IFunctionsHostBuilder) override I can see that I actually get the "Staging" value in my environment. So it gets picked-up properly.
Getting the same warning even though I don't have AZURE_FUNCTIONS_ENVIRONMENT variable in local.settings.json, can anyone explain how is that possible?
How do I know which Env Var is already set? I ran into the same warning.
I have a similar issue, and besides that builder.Environment.EnvironmentName for some reason is not populated with AZURE_FUNCTIONS_ENVIRONMENT value (and always returns "Production")
any help please about that: Skipping 'FUNCTIONS_WORKER_RUNTIME' from local settings as it's already defined in current environment variables. [2025-02-21T21:50:56.607Z] No job functions found. Try making your job classes and methods public. If you're using binding extensions (e.g. Azure Storage, ServiceBus, Timers, etc.) make sure you've called the registration method for the extension(s) in your startup code (e.g. builder.AddAzureStorage(), builder.AddServiceBus(), builder.AddTimers(), etc.). For detailed output, run func with --verbose flag. [2025-02-21T21:51:01.323Z] Host lock lease acquired by instance ID '00000000000000000000000055B935A2'.