Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(iac): Disable resources connection string for PR env instead of soft deleting it #719

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions pipelines/environment-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,18 +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 kill the key vault secret for connection string.
## 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.
## Cannot delete as this would only soft delete the secret and now allow subsequent deployment to create the secret again.
- task: AzurePowerShell@5
displayName: 'Remove db connection string secret'
displayName: 'Disable db connection string secret'
inputs:
azureSubscription: 'PROJECT_PORTAL (63b791ae-b2bc-41a1-ac66-806c4e69bffe)'
ScriptType: InlineScript
FailOnStandardError: true
azurePowerShellVersion: 'LatestVersion'
Inline: |
Write-Host "Deleting secret @ kv-fap-resources-pr/ConnectionStrings--ResourcesDbContext"
Remove-AzKeyVaultSecret -VaultName kv-fap-resources-pr -Name ConnectionStrings--ResourcesDbContext -Force
Write-Host "Disabling secret @ kv-fap-resources-pr/ConnectionStrings--ResourcesDbContext"
Update-AzKeyVaultSecret -VaultName kv-fap-resources-pr -Name ConnectionStrings--ResourcesDbContext -Enable $False


- stage: DeployQA
Expand Down