source/TestCommon/source/FunctionApp.TestCommon/IConfigurationExtensions.cs
/// <summary>
/// This extension method first try to read the setting value as if it was stored in "local.setting.json";
/// if the value is empty, it then try to retrieve it directly in the configuration container.
///
/// NOTICE: Azure Function App settings in "local.settings.json" are stored in the section "Values".
/// </summary>
This extension method first try to read the setting value as if it was stored in "local.setting.json";
if the value is empty, it then try to retrieve it directly in the configuration container.

Azure Function App settings in "local.settings.json" are stored in the section "Values".
This extension method first try to read the setting value as if it was stored in " local . setting . json " ; if the value is empty it then try to retrieve it directly in the configuration container . Azure Function App settings in " local . settings . json " are stored in the section " Values " .
public static string GetValue(this IConfiguration configuration, string settingName)
        {
            var value = configuration[$"Values:{settingName}"];
            return string.IsNullOrEmpty(value)
                ? configuration[settingName]
                : value;
        }
public static string GetValue ( this IConfiguration configuration , string settingName ) { var value = configuration [ $" Values: { settingName } " ] ; return string . IsNullOrEmpty ( value ) ? configuration [ settingName ] : value ; }
This extension method first try to read the setting value as if it was stored in "local.setting.json";
if the value is empty, it then try to retrieve it directly in the configuration container.
This extension method first try to read the setting value as if it was stored in " local . setting . json " ; if the value is empty it then try to retrieve it directly in the configuration container .
IConfiguration
this
settingName
string