From 901774c7edfa2db619ccacc33c910b2ca8f23f0f Mon Sep 17 00:00:00 2001 From: Jonathan Idland Olsnes <73334350+Jonathanio123@users.noreply.github.com> Date: Thu, 7 Nov 2024 11:30:15 +0100 Subject: [PATCH] Try to disable instead of deleting connection string --- pipelines/environment-pipeline.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pipelines/environment-pipeline.yml b/pipelines/environment-pipeline.yml index 4cf8f1098..1b86ecc41 100644 --- a/pipelines/environment-pipeline.yml +++ b/pipelines/environment-pipeline.yml @@ -51,6 +51,19 @@ stages: azureSubscription: 'FRA Automation Non-Prod' coreAzureSubscription: 'PROJECT_PORTAL (63b791ae-b2bc-41a1-ac66-806c4e69bffe)' + ## To get the pr slots to talk to the correct databases, we need to disable the key vault secret for connection string. + ## The secret would override the direct env property used to target the correct db. + - task: AzurePowerShell@5 + displayName: 'Remove db connection string secret' + inputs: + azureSubscription: 'PROJECT_PORTAL (63b791ae-b2bc-41a1-ac66-806c4e69bffe)' + ScriptType: InlineScript + FailOnStandardError: true + azurePowerShellVersion: 'LatestVersion' + Inline: | + Write-Host "Disabling secret @ kv-fap-resources-pr/ConnectionStrings--ResourcesDbContext" + Update-AzKeyVaultSecret -VaultName kv-fap-resources-pr -Name ConnectionStrings--ResourcesDbContext -Enable $False + - stage: DeployQA displayName: QA Azure Infra