We are having problem overrriding settings in live environments because setting names with periods (".") are not supported (by Auzre App Service Configuration, Key Vault and CD pipeline task to transform appsetting.json). So, please cosider changing to use other delimiter like underscore ("_") please.
5 Answer(s)
-
0
if there's a document that you can show this issue (that Azure doesn't accept dots in setting name)
-
0
1. Key Vault We put some credentials in Azure Key Vault and integrate with settings in the
appsettting.json
. The secret names are set in following pattern for hirachycal settings. Unfortunately, they do not support setting name with periods (".").2. Azure App Service Configuration Normally, Azure App Service allow to override settings via app configuraiton. However, for App Service for Container we cannot do that if the setting name consist of periods (".").
-
0
thank you. I've created an issue https://github.com/abpframework/abp/issues/6272 closing this, you can track the GitHub issue.
-
0
hi @rachanee-mwp
You can create a custom
ConfigurationSettingValueProvider
then read settings viaunderscore name
.public override void ConfigureServices(ServiceConfigurationContext context) { Configure<AbpSettingOptions>(options => { options.ValueProviders.InsertAfter(typeof(ConfigurationSettingValueProvider), typeof(MyConfigurationSettingValueProvider)); }); } public class MyConfigurationSettingValueProvider : ISettingValueProvider, ITransientDependency { public const string ConfigurationNamePrefix = "Settings:"; public const string ProviderName = "MC"; public string Name => ProviderName; protected IConfiguration Configuration { get; } public MyConfigurationSettingValueProvider(IConfiguration configuration) { Configuration = configuration; } public virtual Task<string> GetOrNullAsync(SettingDefinition setting) { return Task.FromResult(Configuration[ConfigurationNamePrefix + setting.Name.Replace(".", "_")]); } public Task<List<SettingValue>> GetAllAsync(SettingDefinition[] settings) { return Task.FromResult(settings.Select(x => new SettingValue(x.Name, Configuration[ConfigurationNamePrefix + x.Name.Replace(".", "_")])).ToList()); } }
-
1
@maliming, We do that as a workaround for now, but it would be better to have the those setting names from the framework itself because want to keep code (.cs and appsetting.json files) to be similar to the orginal version as much as possible for ease of code merging when doing upgrading.