diff --git a/Directory.Packages.props b/Directory.Packages.props
index b2ff25ad569..208f6f5cd22 100644
--- a/Directory.Packages.props
+++ b/Directory.Packages.props
@@ -26,12 +26,11 @@
-
-
+
diff --git a/playground/cdk/CdkSample.ApiService/CdkSample.ApiService.csproj b/playground/cdk/CdkSample.ApiService/CdkSample.ApiService.csproj
index 24fe9fc900a..0d2733fd22d 100644
--- a/playground/cdk/CdkSample.ApiService/CdkSample.ApiService.csproj
+++ b/playground/cdk/CdkSample.ApiService/CdkSample.ApiService.csproj
@@ -19,9 +19,9 @@
+
-
diff --git a/src/Components/Aspire.Microsoft.Extensions.Configuration.AzureAppConfiguration/AspireAppConfigurationExtensions.cs b/src/Components/Aspire.Microsoft.Extensions.Configuration.AzureAppConfiguration/AspireAppConfigurationExtensions.cs
index 803d90e466a..da292eaba69 100644
--- a/src/Components/Aspire.Microsoft.Extensions.Configuration.AzureAppConfiguration/AspireAppConfigurationExtensions.cs
+++ b/src/Components/Aspire.Microsoft.Extensions.Configuration.AzureAppConfiguration/AspireAppConfigurationExtensions.cs
@@ -61,5 +61,12 @@ public static void AddAzureAppConfiguration(
settings.Optional);
builder.Services.AddAzureAppConfiguration(); // register IConfigurationRefresherProvider service
+
+ if (!settings.DisableTracing)
+ {
+ builder.Services.AddOpenTelemetry()
+ .WithTracing(traceBuilder =>
+ traceBuilder.AddSource(["Microsoft.Extensions.Configuration.AzureAppConfiguration"]));
+ }
}
}
diff --git a/src/Components/Aspire.Microsoft.Extensions.Configuration.AzureAppConfiguration/AzureAppConfigurationSettings.cs b/src/Components/Aspire.Microsoft.Extensions.Configuration.AzureAppConfiguration/AzureAppConfigurationSettings.cs
index 446639687a9..756398814a7 100644
--- a/src/Components/Aspire.Microsoft.Extensions.Configuration.AzureAppConfiguration/AzureAppConfigurationSettings.cs
+++ b/src/Components/Aspire.Microsoft.Extensions.Configuration.AzureAppConfiguration/AzureAppConfigurationSettings.cs
@@ -28,6 +28,14 @@ public sealed class AzureAppConfigurationSettings : IConnectionStringSettings
///
public bool Optional { get; set; }
+ ///
+ /// Gets or sets a boolean value that indicates whether the OpenTelemetry tracing is disabled or not.
+ ///
+ ///
+ /// The default value is .
+ ///
+ public bool DisableTracing { get; set; }
+
void IConnectionStringSettings.ParseConnectionString(string? connectionString)
{
if (!string.IsNullOrEmpty(connectionString) &&
diff --git a/src/Components/Aspire.Microsoft.Extensions.Configuration.AzureAppConfiguration/ConfigurationSchema.json b/src/Components/Aspire.Microsoft.Extensions.Configuration.AzureAppConfiguration/ConfigurationSchema.json
index 248a28ed985..956d13a7648 100644
--- a/src/Components/Aspire.Microsoft.Extensions.Configuration.AzureAppConfiguration/ConfigurationSchema.json
+++ b/src/Components/Aspire.Microsoft.Extensions.Configuration.AzureAppConfiguration/ConfigurationSchema.json
@@ -25,6 +25,11 @@
"AzureAppConfiguration": {
"type": "object",
"properties": {
+ "DisableTracing": {
+ "type": "boolean",
+ "description": "Gets or sets a boolean value that indicates whether the OpenTelemetry tracing is disabled or not.",
+ "default": false
+ },
"Endpoint": {
"type": "string",
"format": "uri",
diff --git a/src/Components/Aspire.Microsoft.Extensions.Configuration.AzureAppConfiguration/README.md b/src/Components/Aspire.Microsoft.Extensions.Configuration.AzureAppConfiguration/README.md
index 2038a3be9e8..16cffc84ebe 100644
--- a/src/Components/Aspire.Microsoft.Extensions.Configuration.AzureAppConfiguration/README.md
+++ b/src/Components/Aspire.Microsoft.Extensions.Configuration.AzureAppConfiguration/README.md
@@ -1,6 +1,6 @@
# Aspire.Microsoft.Extensions.Configuration.AzureAppConfiguration
-Retrieves configuration settings from Azure App Configuration to use in your application. Registers Azure App Configuration service as a configuration source. Enables corresponding logging.
+Retrieves configuration settings from Azure App Configuration to use in your application. Registers Azure App Configuration service as a configuration source. Enables corresponding logging and telemetry.
## Getting started
diff --git a/src/Components/Aspire_Components_Progress.md b/src/Components/Aspire_Components_Progress.md
index 4c742aac166..cddf73993bd 100644
--- a/src/Components/Aspire_Components_Progress.md
+++ b/src/Components/Aspire_Components_Progress.md
@@ -10,9 +10,9 @@ These integrations should follow the [.NET Aspire Integration Requirements](#net
| Microsoft.Data.SqlClient | ✅ | ✅ | ✅ | ✅ | ❌ | ✅ | ❌ | ✅ |
| Microsoft.EntityFramework.Cosmos | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ |
| Microsoft.EntityFrameworkCore.SqlServer | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ✅ |
-| Microsoft.Extensions.Configuration.AzureAppConfiguration | ✅ | ✅ | ✅ | ✅ | ✅ | | ❌ | |
+| Microsoft.Extensions.Configuration.AzureAppConfiguration | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | |
| MongoDB.Driver | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ✅ |
-| Azure.AI.Inference | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ |
+| Azure.AI.Inference | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ |
| Azure.AI.OpenAI | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ |
| Azure.Data.Tables | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ✅ |
| Azure.Messaging.EventHubs | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | |
diff --git a/tests/Aspire.Microsoft.Extensions.Configuration.AzureAppConfiguration.Tests/ConfigurationTests.cs b/tests/Aspire.Microsoft.Extensions.Configuration.AzureAppConfiguration.Tests/ConfigurationTests.cs
index 49ee121899f..fbbae412a0b 100644
--- a/tests/Aspire.Microsoft.Extensions.Configuration.AzureAppConfiguration.Tests/ConfigurationTests.cs
+++ b/tests/Aspire.Microsoft.Extensions.Configuration.AzureAppConfiguration.Tests/ConfigurationTests.cs
@@ -11,6 +11,7 @@ public class ConfigurationTests
public void EndpointUriIsNullByDefault()
=> Assert.Null(new AzureAppConfigurationSettings().Endpoint);
- // WIP: https://github.com/Azure/AppConfiguration-DotnetProvider/pull/645
- // Tracing will be supported in the next 8.2.0 release
+ [Fact]
+ public void TracingIsEnabledByDefault()
+ => Assert.False(new AzureAppConfigurationSettings().DisableTracing);
}
diff --git a/tests/Aspire.Microsoft.Extensions.Configuration.AzureAppConfiguration.Tests/ConformanceTests.cs b/tests/Aspire.Microsoft.Extensions.Configuration.AzureAppConfiguration.Tests/ConformanceTests.cs
index dffa9c1c517..65ba558867a 100644
--- a/tests/Aspire.Microsoft.Extensions.Configuration.AzureAppConfiguration.Tests/ConformanceTests.cs
+++ b/tests/Aspire.Microsoft.Extensions.Configuration.AzureAppConfiguration.Tests/ConformanceTests.cs
@@ -33,7 +33,8 @@ public class ConformanceTests : ConformanceTests new[]
{
("""{"Aspire": { "Microsoft": { "Extensions": { "Configuration": { "AzureAppConfiguration": { "Endpoint": "YOUR_URI"}}}}}}""", "Value does not match format \"uri\""),
- ("""{"Aspire": { "Microsoft": { "Extensions": { "Configuration": { "AzureAppConfiguration": { "Endpoint": "http://YOUR_URI", "Optional": "true"}}}}}}""", "Value is \"string\" but should be \"boolean\"")
+ ("""{"Aspire": { "Microsoft": { "Extensions": { "Configuration": { "AzureAppConfiguration": { "Endpoint": "http://YOUR_URI", "Optional": "true"}}}}}}""", "Value is \"string\" but should be \"boolean\""),
+ ("""{"Aspire": { "Microsoft": { "Extensions": { "Configuration": { "AzureAppConfiguration": { "Endpoint": "http://YOUR_URI", "DisableTracing": "true"}}}}}}""", "Value is \"string\" but should be \"boolean\""),
};
protected override void SetHealthCheck(AzureAppConfigurationSettings options, bool enabled)
@@ -89,19 +91,18 @@ protected override void SetMetrics(AzureAppConfigurationSettings options, bool e
=> throw new NotImplementedException();
protected override void SetTracing(AzureAppConfigurationSettings options, bool enabled)
- // WIP: https://github.com/Azure/AppConfiguration-DotnetProvider/pull/645
- // Will be supported in the next 8.2.0 release
- => throw new NotImplementedException();
+ => options.DisableTracing = !enabled;
protected override void TriggerActivity(IConfigurationRefresherProvider service)
- // WIP: https://github.com/Azure/AppConfiguration-DotnetProvider/pull/645
- // Will be supported in the next 8.2.0 release
- => throw new NotImplementedException();
+ {
+ // wait for 1 seconds to ensure the refresh interval is exceeded
+ Task.Delay(1000).ConfigureAwait(false).GetAwaiter().GetResult();
+ service.Refreshers.First().RefreshAsync().ConfigureAwait(false).GetAwaiter().GetResult();
+ }
[Fact]
public void TracingEnablesTheRightActivitySource()
- // WIP: Waiting for App Configuration Provider 8.2.0 release
- => RemoteExecutor.Invoke(() => /*ActivitySourceTest(key: null)*/ null).Dispose();
+ => RemoteExecutor.Invoke(() => ActivitySourceTest(key: null)).Dispose();
internal sealed class EmptyTokenCredential : TokenCredential
{