diff --git a/examples/DotNetCore/AzureFunction/AzureFunction.sln b/examples/DotNetCore/AzureFunction/AzureFunction.sln
deleted file mode 100644
index a6e6d8be..00000000
--- a/examples/DotNetCore/AzureFunction/AzureFunction.sln
+++ /dev/null
@@ -1,31 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio Version 17
-VisualStudioVersion = 17.1.31904.369
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FunctionApp", "FunctionApp\FunctionApp.csproj", "{8C4BCA4B-3413-4757-A27A-CD19319BB84E}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FunctionAppIsolatedMode", "FunctionAppIsolatedMode\FunctionAppIsolatedMode.csproj", "{1F856589-317F-4708-B6D8-491EA899FEC0}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Release|Any CPU = Release|Any CPU
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {8C4BCA4B-3413-4757-A27A-CD19319BB84E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {8C4BCA4B-3413-4757-A27A-CD19319BB84E}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {8C4BCA4B-3413-4757-A27A-CD19319BB84E}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {8C4BCA4B-3413-4757-A27A-CD19319BB84E}.Release|Any CPU.Build.0 = Release|Any CPU
- {1F856589-317F-4708-B6D8-491EA899FEC0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {1F856589-317F-4708-B6D8-491EA899FEC0}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {1F856589-317F-4708-B6D8-491EA899FEC0}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {1F856589-317F-4708-B6D8-491EA899FEC0}.Release|Any CPU.Build.0 = Release|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
- GlobalSection(ExtensibilityGlobals) = postSolution
- SolutionGuid = {84007F82-034B-4153-A3A6-A3EB0DEA748F}
- EndGlobalSection
-EndGlobal
diff --git a/examples/DotNetCore/AzureFunction/FunctionApp/FunctionApp.csproj b/examples/DotNetCore/AzureFunction/FunctionApp/FunctionApp.csproj
deleted file mode 100644
index 4f5b14fb..00000000
--- a/examples/DotNetCore/AzureFunction/FunctionApp/FunctionApp.csproj
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
- net6.0
- v4
-
-
-
-
-
-
-
-
-
-
- PreserveNewest
-
-
- PreserveNewest
- Never
-
-
-
\ No newline at end of file
diff --git a/examples/DotNetCore/AzureFunction/FunctionApp/ReadQueuedMessage.cs b/examples/DotNetCore/AzureFunction/FunctionApp/ReadQueuedMessage.cs
deleted file mode 100644
index d507fab5..00000000
--- a/examples/DotNetCore/AzureFunction/FunctionApp/ReadQueuedMessage.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-using Microsoft.Azure.WebJobs;
-using Microsoft.Extensions.Logging;
-
-namespace FunctionApp
-{
- public static class ReadQueuedMessage
- {
- // Queue triggered function with queue name defined in Azure App Configuration.
- // The app setting binding expression is used. See details at
- // https://docs.microsoft.com/azure/azure-functions/functions-bindings-expressions-patterns
- [FunctionName("ReadQueuedMessage")]
- public static void Run(
- [QueueTrigger(queueName: "%TestApp:Storage:QueueName%")] string myQueueItem,
- ILogger log)
- {
- log.LogInformation($"C# Queue trigger function processed: {myQueueItem}");
- }
- }
-}
diff --git a/examples/DotNetCore/AzureFunction/FunctionApp/ShowBetaFeature.cs b/examples/DotNetCore/AzureFunction/FunctionApp/ShowBetaFeature.cs
deleted file mode 100644
index 6bb49775..00000000
--- a/examples/DotNetCore/AzureFunction/FunctionApp/ShowBetaFeature.cs
+++ /dev/null
@@ -1,45 +0,0 @@
-using System.Linq;
-using System.Threading.Tasks;
-using Microsoft.AspNetCore.Http;
-using Microsoft.AspNetCore.Mvc;
-using Microsoft.Azure.WebJobs;
-using Microsoft.Azure.WebJobs.Extensions.Http;
-using Microsoft.Extensions.Configuration.AzureAppConfiguration;
-using Microsoft.Extensions.Logging;
-using Microsoft.FeatureManagement;
-
-namespace FunctionApp
-{
- public class ShowBetaFeature
- {
- private readonly IFeatureManagerSnapshot _featureManagerSnapshot;
- private readonly IConfigurationRefresher _configurationRefresher;
-
- public ShowBetaFeature(IFeatureManagerSnapshot featureManagerSnapshot, IConfigurationRefresherProvider refresherProvider)
- {
- _featureManagerSnapshot = featureManagerSnapshot;
- _configurationRefresher = refresherProvider.Refreshers.First();
- }
-
- [FunctionName("ShowBetaFeature")]
- public async Task Run(
- [HttpTrigger(AuthorizationLevel.Anonymous, "get", "post", Route = null)] HttpRequest req,
- ILogger log)
- {
- log.LogInformation("C# HTTP trigger function processed a request.");
-
- // Signal to refresh the feature flags from Azure App Configuration.
- // This will be a no-op if the cache expiration time window is not reached.
- // Remove the 'await' operator if it's preferred to refresh without blocking.
- await _configurationRefresher.TryRefreshAsync();
-
- string featureName = "Beta";
- bool featureEnalbed = await _featureManagerSnapshot.IsEnabledAsync(featureName);
-
- return featureEnalbed
- ? (ActionResult)new OkObjectResult($"{featureName} feature is On")
- : new BadRequestObjectResult($"{featureName} feature is Off (or the feature flag '{featureName}' is not present in Azure App Configuration).");
-
- }
- }
-}
diff --git a/examples/DotNetCore/AzureFunction/FunctionApp/ShowMessage.cs b/examples/DotNetCore/AzureFunction/FunctionApp/ShowMessage.cs
deleted file mode 100644
index 1c79dbf8..00000000
--- a/examples/DotNetCore/AzureFunction/FunctionApp/ShowMessage.cs
+++ /dev/null
@@ -1,44 +0,0 @@
-using System.Linq;
-using System.Threading.Tasks;
-using Microsoft.AspNetCore.Http;
-using Microsoft.AspNetCore.Mvc;
-using Microsoft.Azure.WebJobs;
-using Microsoft.Azure.WebJobs.Extensions.Http;
-using Microsoft.Extensions.Configuration;
-using Microsoft.Extensions.Configuration.AzureAppConfiguration;
-using Microsoft.Extensions.Logging;
-
-namespace FunctionApp
-{
- public class ShowMessage
- {
- private readonly IConfiguration _configuration;
- private readonly IConfigurationRefresher _configurationRefresher;
-
- public ShowMessage(IConfiguration configuration, IConfigurationRefresherProvider refresherProvider)
- {
- _configuration = configuration;
- _configurationRefresher = refresherProvider.Refreshers.First();
- }
-
- [FunctionName("ShowMessage")]
- public async Task Run(
- [HttpTrigger(AuthorizationLevel.Anonymous, "get", "post", Route = null)] HttpRequest req,
- ILogger log)
- {
- log.LogInformation("C# HTTP trigger function processed a request.");
-
- // Signal to refresh the configuration if the registered key(s) is modified.
- // This will be a no-op if the cache expiration time window is not reached.
- // The configuration is refreshed asynchronously without blocking the execution of the current function.
- _ = _configurationRefresher.TryRefreshAsync();
-
- string key = "TestApp:Settings:Message";
- string message = _configuration[key];
-
- return message != null
- ? (ActionResult)new OkObjectResult(message)
- : new BadRequestObjectResult($"Please create a key-value with the key '{key}' in Azure App Configuration.");
- }
- }
-}
diff --git a/examples/DotNetCore/AzureFunction/FunctionApp/Startup.cs b/examples/DotNetCore/AzureFunction/FunctionApp/Startup.cs
deleted file mode 100644
index b97f2eaa..00000000
--- a/examples/DotNetCore/AzureFunction/FunctionApp/Startup.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-using System;
-using Microsoft.Azure.Functions.Extensions.DependencyInjection;
-using Microsoft.Extensions.Configuration;
-using Microsoft.FeatureManagement;
-
-[assembly: FunctionsStartup(typeof(FunctionApp.Startup))]
-
-namespace FunctionApp
-{
- class Startup : FunctionsStartup
- {
- public override void ConfigureAppConfiguration(IFunctionsConfigurationBuilder builder)
- {
- // Add Azure App Configuration as additional configuration source
- builder.ConfigurationBuilder.AddAzureAppConfiguration(options =>
- {
- options.Connect(Environment.GetEnvironmentVariable("ConnectionString"))
- // Load all keys that start with `TestApp:` and have no label
- .Select("TestApp:*")
- // Configure to reload configuration if the registered key 'TestApp:Settings:Sentinel' is modified.
- // Use the default cache expiration of 30 seconds. It can be overriden via AzureAppConfigurationRefreshOptions.SetCacheExpiration.
- .ConfigureRefresh(refreshOptions =>
- refreshOptions.Register("TestApp:Settings:Sentinel", refreshAll: true)
- )
- // Load all feature flags with no label. To load specific feature flags and labels, set via FeatureFlagOptions.Select.
- // Use the default cache expiration of 30 seconds. It can be overriden via FeatureFlagOptions.CacheExpirationInterval.
- .UseFeatureFlags();
- });
- }
-
- public override void Configure(IFunctionsHostBuilder builder)
- {
- // Make Azure App Configuration services and feature manager available through dependency injection
- builder.Services.AddAzureAppConfiguration();
- builder.Services.AddFeatureManagement();
- }
- }
-}
diff --git a/examples/DotNetCore/AzureFunction/FunctionApp/host.json b/examples/DotNetCore/AzureFunction/FunctionApp/host.json
deleted file mode 100644
index b9f92c0d..00000000
--- a/examples/DotNetCore/AzureFunction/FunctionApp/host.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "version": "2.0"
-}
\ No newline at end of file
diff --git a/examples/DotNetCore/AzureFunction/FunctionAppIsolatedMode/FunctionAppIsolatedMode.csproj b/examples/DotNetCore/AzureFunction/FunctionAppIsolatedMode/FunctionAppIsolatedMode.csproj
deleted file mode 100644
index 5b1a8c3e..00000000
--- a/examples/DotNetCore/AzureFunction/FunctionAppIsolatedMode/FunctionAppIsolatedMode.csproj
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
- net6.0
- v4
- Exe
-
-
-
-
-
-
-
-
-
-
- PreserveNewest
-
-
- PreserveNewest
- Never
-
-
-
diff --git a/examples/DotNetCore/AzureFunction/FunctionAppIsolatedMode/Program.cs b/examples/DotNetCore/AzureFunction/FunctionAppIsolatedMode/Program.cs
deleted file mode 100644
index 5e216d4f..00000000
--- a/examples/DotNetCore/AzureFunction/FunctionAppIsolatedMode/Program.cs
+++ /dev/null
@@ -1,47 +0,0 @@
-using Microsoft.Extensions.Configuration;
-using Microsoft.Extensions.Hosting;
-using Microsoft.FeatureManagement;
-using System;
-
-namespace FunctionAppIsolatedMode
-{
- public class Program
- {
- public static void Main()
- {
- var host = new HostBuilder()
- .ConfigureAppConfiguration(builder =>
- {
- builder.AddAzureAppConfiguration(options =>
- {
- options.Connect(Environment.GetEnvironmentVariable("ConnectionString"))
- // Load all keys that start with `TestApp:` and have no label
- .Select("TestApp:*")
- // Configure to reload configuration if the registered key 'TestApp:Settings:Sentinel' is modified.
- // Use the default cache expiration of 30 seconds. It can be overriden via AzureAppConfigurationRefreshOptions.SetCacheExpiration.
- .ConfigureRefresh(refreshOptions =>
- {
- refreshOptions.Register("TestApp:Settings:Sentinel", refreshAll: true);
- })
- // Load all feature flags with no label. To load specific feature flags and labels, set via FeatureFlagOptions.Select.
- // Use the default cache expiration of 30 seconds. It can be overriden via FeatureFlagOptions.CacheExpirationInterval.
- .UseFeatureFlags();
- });
- })
- .ConfigureServices(services =>
- {
- // Make Azure App Configuration services and feature manager available through dependency injection
- services.AddAzureAppConfiguration()
- .AddFeatureManagement();
- })
- .ConfigureFunctionsWorkerDefaults(app =>
- {
- // Use Azure App Configuration middleware for data refresh
- app.UseAzureAppConfiguration();
- })
- .Build();
-
- host.Run();
- }
- }
-}
diff --git a/examples/DotNetCore/AzureFunction/FunctionAppIsolatedMode/ShowBetaFeature.cs b/examples/DotNetCore/AzureFunction/FunctionAppIsolatedMode/ShowBetaFeature.cs
deleted file mode 100644
index 1a119cd6..00000000
--- a/examples/DotNetCore/AzureFunction/FunctionAppIsolatedMode/ShowBetaFeature.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-using System.Net;
-using System.Threading.Tasks;
-using Microsoft.Azure.Functions.Worker;
-using Microsoft.Azure.Functions.Worker.Http;
-using Microsoft.Extensions.Logging;
-using Microsoft.FeatureManagement;
-
-namespace FunctionAppIsolatedMode
-{
- public class ShowBetaFeature
- {
- private readonly IFeatureManagerSnapshot _featureManagerSnapshot;
- private readonly ILogger _logger;
-
- public ShowBetaFeature(IFeatureManagerSnapshot featureManagerSnapshot, ILoggerFactory loggerFactory)
- {
- _featureManagerSnapshot = featureManagerSnapshot;
- _logger = loggerFactory.CreateLogger();
- }
-
- [Function("ShowBetaFeature")]
- public async Task Run([HttpTrigger(AuthorizationLevel.Anonymous, "get", "post")] HttpRequestData req)
- {
- _logger.LogInformation("C# HTTP trigger function processed a request.");
-
- var response = req.CreateResponse(HttpStatusCode.OK);
- response.Headers.Add("Content-Type", "text/plain; charset=utf-8");
-
- // Read feature flag
- string featureName = "Beta";
- bool featureEnalbed = await _featureManagerSnapshot.IsEnabledAsync(featureName);
-
- response.WriteString(featureEnalbed
- ? $"{featureName} feature is On"
- : $"{featureName} feature is Off (or the feature flag '{featureName}' is not present in Azure App Configuration).");
-
- return response;
- }
- }
-}
diff --git a/examples/DotNetCore/AzureFunction/FunctionAppIsolatedMode/ShowMessage.cs b/examples/DotNetCore/AzureFunction/FunctionAppIsolatedMode/ShowMessage.cs
deleted file mode 100644
index afb3e9b7..00000000
--- a/examples/DotNetCore/AzureFunction/FunctionAppIsolatedMode/ShowMessage.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-using System.Net;
-using Microsoft.Azure.Functions.Worker;
-using Microsoft.Azure.Functions.Worker.Http;
-using Microsoft.Extensions.Configuration;
-using Microsoft.Extensions.Logging;
-
-namespace FunctionAppIsolatedMode
-{
- public class ShowMessage
- {
- private readonly IConfiguration _configuration;
- private readonly ILogger _logger;
-
- public ShowMessage(IConfiguration configuration, ILoggerFactory loggerFactory)
- {
- _configuration = configuration;
- _logger = loggerFactory.CreateLogger();
- }
-
- [Function("ShowMessage")]
- public HttpResponseData Run([HttpTrigger(AuthorizationLevel.Anonymous, "get", "post")] HttpRequestData req)
- {
- _logger.LogInformation("C# HTTP trigger function processed a request.");
-
- var response = req.CreateResponse(HttpStatusCode.OK);
- response.Headers.Add("Content-Type", "text/plain; charset=utf-8");
-
- // Read configuration data
- string key = "TestApp:Settings:Message";
- string message = _configuration[key];
-
- response.WriteString(message ?? $"Please create a key-value with the key '{key}' in Azure App Configuration.");
-
- return response;
- }
- }
-}
diff --git a/examples/DotNetCore/AzureFunction/FunctionAppIsolatedMode/host.json b/examples/DotNetCore/AzureFunction/FunctionAppIsolatedMode/host.json
deleted file mode 100644
index d2059a46..00000000
--- a/examples/DotNetCore/AzureFunction/FunctionAppIsolatedMode/host.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "version": "2.0"
-}
diff --git a/examples/DotNetCore/AzureFunctions/FunctionAppInProcess/ShowBetaFeature.cs b/examples/DotNetCore/AzureFunctions/FunctionAppInProcess/ShowBetaFeature.cs
index 0fe2e716..6ec4142f 100644
--- a/examples/DotNetCore/AzureFunctions/FunctionAppInProcess/ShowBetaFeature.cs
+++ b/examples/DotNetCore/AzureFunctions/FunctionAppInProcess/ShowBetaFeature.cs
@@ -29,7 +29,7 @@ public async Task Run(
// Read feature flag
string featureName = "Beta";
- bool featureEnabled = await _featureManager.IsEnabledAsync(featureName);
+ bool featureEnabled = await _featureManager.IsEnabledAsync(featureName, req.HttpContext.RequestAborted);
return new OkObjectResult(featureEnabled
? $"{featureName} feature is On"
diff --git a/examples/DotNetCore/AzureFunctions/FunctionAppIsolated/ShowBetaFeature.cs b/examples/DotNetCore/AzureFunctions/FunctionAppIsolated/ShowBetaFeature.cs
index 135e8c28..51a11d3f 100644
--- a/examples/DotNetCore/AzureFunctions/FunctionAppIsolated/ShowBetaFeature.cs
+++ b/examples/DotNetCore/AzureFunctions/FunctionAppIsolated/ShowBetaFeature.cs
@@ -24,7 +24,7 @@ public async Task Run([HttpTrigger(AuthorizationLevel.Anonymous,
// Read feature flag
string featureName = "Beta";
- bool featureEnabled = await _featureManager.IsEnabledAsync(featureName);
+ bool featureEnabled = await _featureManager.IsEnabledAsync(featureName, req.HttpContext.RequestAborted);
return new OkObjectResult(featureEnabled
? $"{featureName} feature is On"
diff --git a/examples/README.md b/examples/README.md
index 25cafb62..f3982931 100644
--- a/examples/README.md
+++ b/examples/README.md
@@ -1,14 +1,14 @@
# Azure App Configuration Examples
-## DotNet Samples
+## .NET Samples
-### [Azure Functions (In-process)](./DotNetCore/AzureFunction/FunctionApp)
+### [Azure Functions (Isolated worker model)](./DotNetCore/AzureFunctions/FunctionAppIsolated)
-This example is a .NET class library Function App, which runs in-process with the runtime of Azure Functions. It demonstrates how to enable dynamic configuration and use feature flags from App Configuration. It also shows how to leverage App Configuration for a queue triggered function with the trigger settings stored in App Configuration.
+This example showcases a .NET isolated worker model Function App, which operates out-of-process in Azure Functions. It demonstrates how to enable dynamic configuration and utilize feature flags from App Configuration. Additionally, it illustrates how to leverage the App Configuration references feature in Azure Functions to manage trigger parameters within App Configuration.
-### [Azure Functions (Out-of-process)](./DotNetCore/AzureFunction/FunctionAppIsolatedMode)
+### [Azure Functions (In-process model)](./DotNetCore/AzureFunctions/FunctionAppInProcess)
-This example is a .NET isolated process Function App, which runs out-of-process in Azure Functions. It demonstrates how to enable dynamic configuration and use feature flags from App Configuration.
+This example showcases a .NET class library Function App, which runs in-process with the Azure Functions runtime. It demonstrates how to enable dynamic configuration and utilize feature flags from App Configuration. Additionally, it illustrates how to leverage App Configuration for a queue-triggered function, with the trigger settings stored in App Configuration.
### [ConsoleApplication](./DotNetCore/ConsoleApplication)