Tostisto
Tostisto
CC#
Created by Tostisto on 3/20/2025 in #help
Azure function connection string from azure app configuration store
The function work correctly, because we uses the environment variables before. but not we migrate to app configuration store and this happened
97 replies
CC#
Created by Tostisto on 3/20/2025 in #help
Azure function connection string from azure app configuration store
Yes, this works
97 replies
CC#
Created by Tostisto on 3/20/2025 in #help
Azure function connection string from azure app configuration store
now local
97 replies
CC#
Created by Tostisto on 3/20/2025 in #help
Azure function connection string from azure app configuration store
[2025-03-20T20:16:55.036Z] The 'EventLoggerFunction' function is in error: Microsoft.Azure.WebJobs.Host: Error indexing method 'Functions.EventLoggerFunction'. Microsoft.Azure.WebJobs.Host: '%ServiceBuses:ConnectionString%' does not resolve to a value.
97 replies
CC#
Created by Tostisto on 3/20/2025 in #help
Azure function connection string from azure app configuration store
Ok, Thanks, i will try find better solution for that
97 replies
CC#
Created by Tostisto on 3/20/2025 in #help
Azure function connection string from azure app configuration store
thats because why i have some__some
97 replies
CC#
Created by Tostisto on 3/20/2025 in #help
Azure function connection string from azure app configuration store
And it is from historical puposes
97 replies
CC#
Created by Tostisto on 3/20/2025 in #help
Azure function connection string from azure app configuration store
I do not mean value, but the key.
97 replies
CC#
Created by Tostisto on 3/20/2025 in #help
Azure function connection string from azure app configuration store
Not at all. The my mess code that i send you replace the __ to : , then create json and load as a json. but then i have still the error Service Bus account connection string with name ServiceBus:ConnectionString 😄
97 replies
CC#
Created by Tostisto on 3/20/2025 in #help
Azure function connection string from azure app configuration store
I can not change that value in appconfiguration
97 replies
CC#
Created by Tostisto on 3/20/2025 in #help
Azure function connection string from azure app configuration store
but this is not working at all
97 replies
CC#
Created by Tostisto on 3/20/2025 in #help
Azure function connection string from azure app configuration store
and then the connection in the function will be like ServiceBuses:ConnectionString
97 replies
CC#
Created by Tostisto on 3/20/2025 in #help
Azure function connection string from azure app configuration store
so i need to replace __ to :
97 replies
CC#
Created by Tostisto on 3/20/2025 in #help
Azure function connection string from azure app configuration store
yes that is in ideal word. but i have the key in the appconfiguration like this ServiceBuses__ConnectionString
97 replies
CC#
Created by Tostisto on 3/20/2025 in #help
Azure function connection string from azure app configuration store
yes
97 replies
CC#
Created by Tostisto on 3/20/2025 in #help
Azure function connection string from azure app configuration store
the json use the :
97 replies
CC#
Created by Tostisto on 3/20/2025 in #help
Azure function connection string from azure app configuration store
this is what i have
var appConfigBuilder = new ConfigurationBuilder()
.AddAzureAppConfiguration(options =>
{
options.Connect(azureAppConfigurationConnectionString)
})
.Build();

var transformedConfig = appConfigBuilder.AsEnumerable()
.GroupBy(k => k.Key.Replace("__", ":"))
.ToDictionary(g => g.Key, g => g.First().Value);

var json = JsonConvert.SerializeObject(transformedConfig, Formatting.Indented);
var jsonFilePath = Path.Combine(Path.GetTempPath(), "test.json");
File.WriteAllText(jsonFilePath, json);
configuration.AddJsonFile(jsonFilePath, optional: true, reloadOnChange: true);
var appConfigBuilder = new ConfigurationBuilder()
.AddAzureAppConfiguration(options =>
{
options.Connect(azureAppConfigurationConnectionString)
})
.Build();

var transformedConfig = appConfigBuilder.AsEnumerable()
.GroupBy(k => k.Key.Replace("__", ":"))
.ToDictionary(g => g.Key, g => g.First().Value);

var json = JsonConvert.SerializeObject(transformedConfig, Formatting.Indented);
var jsonFilePath = Path.Combine(Path.GetTempPath(), "test.json");
File.WriteAllText(jsonFilePath, json);
configuration.AddJsonFile(jsonFilePath, optional: true, reloadOnChange: true);
97 replies
CC#
Created by Tostisto on 3/20/2025 in #help
Azure function connection string from azure app configuration store
but it does not help
97 replies
CC#
Created by Tostisto on 3/20/2025 in #help
Azure function connection string from azure app configuration store
I tried to use the AddJsonStream
97 replies
CC#
Created by Tostisto on 3/20/2025 in #help
Azure function connection string from azure app configuration store
Also i am a little bit special and the key in the app configuration store are separated by __ some i have for example servicebus_connectionstring and in am parsing it into servicebus:connectionstring
97 replies