Azure App Configuration key values not getting refreshed at runtime
@amerjusupovic is already working on this.
Since Feb 16, 2025.
Assessment
This issue has not been assessed yet.
Description
Hi,
I have built a simple Microsoft custom engine copilot using Teams AI library in C#
I tried to integrate with Azure App Configuration into this app with below code snippet in my Program.cs
//More about sentinel configuration key -
//https://learn.microsoft.com/en-us/azure/azure-app-configuration/enable-dynamic-configuration-aspnet-core#add-a-sentinel-key
builder.Configuration.AddAzureAppConfiguration(options =>
options
.Connect(new Uri(appConfiguration.AzureAppConfiguration.Url), tokenCredential)
.Select(KeyFilter.Any, appConfiguration.AzureAppConfiguration.EnvironmentLabel)
.ConfigureRefresh(refreshOptions =>
refreshOptions
.Register("TestApp:SentinelKey", appConfiguration.AzureAppConfiguration.EnvironmentLabel, refreshAll: true)
.SetRefreshInterval(TimeSpan.FromSeconds(5))));
builder.Services.AddAzureAppConfiguration();
builder.Services.Configure<AzureADApplication>(builder.Configuration.GetSection(Constants.AppConfigurationPrefix.AzureADApplication));
And then later in the same Program.cs file -
WebApplication app = builder.Build();
app.UseAzureAppConfiguration();
Class definition of AzureADApplication -
public class AzureADApplication
{
public string Type { get; set; }
}
Using it like below in the Bot Action code -
public CustomCopilotBotActions(
IOptionsSnapshot<AzureADApplication> appConfiguration,
IServiceProvider serviceProvider)
{
this.appConfiguration = appConfiguration.Value;
}
Created App Configuration resource in Azure which has a sample configuration like
- Key: "AzureADApplication:Type", Value: "abc", Label: "DEV"
- Key: "TestApp:SentinelKey", Value: "1", Label: "DEV"
Everything works fine when application starts-up (Bot side loaded in Teams), I could see the values loaded into "appConfiguration" in the constructor above. However, if I change the value in "AzureADApplication:Type" on Azure and then update the sentinel key as well, the next request to the application (even after 5, 10 etc. seconds) doesn't get this reflected value in "Type" property of appConfiguration in the constructor above (the constructor gets called of-course for every request).
It works fine with the sample application with console/webapp provided as part of Azure App Configuration documentation but not in this. Not sure what I'm missing here. Could this be specifically related to Bot and/or Teams AI Library SDK? Doesn't think so.
Thoughts?
- Dominant language
- No language data
- Stars
- 263
- Forks
- 82
- Avg merge
- 3d 15h
- Merged PRs (30d)
- 6
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Azure/AppConfiguration
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
Azure/AppConfiguration#1155 · 3 comments ·
-
question
Difficulty 4/5 3-5 days Newbie friendliness 30/100
Azure/AppConfiguration#1126 · 5 comments ·
-
enhancement service
Difficulty 5/5 Over a week Newbie friendliness 20/100
Azure/AppConfiguration#1125 ·
-
enhancement FeatureManagement
Difficulty 5/5 Over a week Newbie friendliness 20/100
Azure/AppConfiguration#1124 ·
-
enhancement FeatureManagement service
Difficulty 5/5 Over a week Newbie friendliness 25/100
Azure/AppConfiguration#1123 ·