From af9d272dbdd15030a8669e7f7ec6761bf4960936 Mon Sep 17 00:00:00 2001 From: Sondre Jahrsengene Date: Mon, 22 Sep 2025 16:27:25 +0200 Subject: [PATCH] diag: add azureeventsourcelistener to plugincredentialservice --- Dan.Common/Services/PluginCredentialService.cs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Dan.Common/Services/PluginCredentialService.cs b/Dan.Common/Services/PluginCredentialService.cs index 11fb0b5..8cc2010 100644 --- a/Dan.Common/Services/PluginCredentialService.cs +++ b/Dan.Common/Services/PluginCredentialService.cs @@ -1,5 +1,6 @@ using AsyncKeyedLock; using Azure.Core; +using Azure.Core.Diagnostics; using Azure.Identity; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Logging; @@ -24,7 +25,16 @@ public interface IPluginCredentialService /// public class PluginCredentialService(IConfiguration configuration, ILogger logger) : IPluginCredentialService { - private readonly DefaultAzureCredential credentials = new(); + private static readonly DefaultAzureCredentialOptions Options = new() + { + Diagnostics = + { + LoggedHeaderNames = { "x-ms-request-id" }, + LoggedQueryParameters = { "api-version" }, + IsAccountIdentifierLoggingEnabled = true + } + }; + private readonly DefaultAzureCredential credentials = new(Options); private readonly AsyncNonKeyedLocker semaphore = new(1); /// @@ -45,6 +55,7 @@ public class PluginCredentialService(IConfiguration configuration, ILogger