From 0e344805badd7f97c740de2949967934d247fa7b Mon Sep 17 00:00:00 2001 From: Collin Barrett Date: Mon, 17 Jun 2024 10:45:36 -0500 Subject: [PATCH] =?UTF-8?q?feat(dir-data):=20=E2=9C=A8=20enable=20sensitiv?= =?UTF-8?q?e=20data=20logging=20in=20migration=20Action?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/directory-migrate.yml | 2 ++ .../ConfigurationExtensions.cs | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/directory-migrate.yml b/.github/workflows/directory-migrate.yml index ac2adf46b..2d14d41ad 100644 --- a/.github/workflows/directory-migrate.yml +++ b/.github/workflows/directory-migrate.yml @@ -82,6 +82,8 @@ jobs: -p FilterLists.Directory.Infrastructure.Migrations -s FilterLists.Directory.Api working-directory: ./services/Directory + env: + DOTNET_RUNNING_EF_CORE_TOOLS: true - name: Commit Effective Migration run: | diff --git a/services/Directory/FilterLists.Directory.Infrastructure/ConfigurationExtensions.cs b/services/Directory/FilterLists.Directory.Infrastructure/ConfigurationExtensions.cs index a3f86d2f3..d93eeec3c 100644 --- a/services/Directory/FilterLists.Directory.Infrastructure/ConfigurationExtensions.cs +++ b/services/Directory/FilterLists.Directory.Infrastructure/ConfigurationExtensions.cs @@ -19,7 +19,10 @@ public static void AddInfrastructure(this IHostApplicationBuilder builder) // retry on Microsoft.Data.SqlClient.SqlException (0x80131904): A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: TCP Provider, error: 0 - Undefined error: 0) so.EnableRetryOnFailure([0]) .MigrationsAssembly(MigrationsAssembly)) - .UseQueryTrackingBehavior(QueryTrackingBehavior.NoTracking)); + .UseQueryTrackingBehavior(QueryTrackingBehavior.NoTracking) + .EnableSensitiveDataLogging(string.Equals( + Environment.GetEnvironmentVariable("DOTNET_RUNNING_EF_CORE_TOOLS"), "true", + StringComparison.OrdinalIgnoreCase))); builder.Services.AddHostedService(); builder.Services.AddMemoryCache(); }