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

Add soft delete to workspace storage account #4389

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 3 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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
**BREAKING CHANGES & MIGRATIONS**:

ENHANCEMENTS:
* Add 7 day retention on workspace storage accounts. ([#4389](https://github.com/microsoft/AzureTRE/issues/4389))

BUG FIXES:

Expand Down
14 changes: 7 additions & 7 deletions templates/workspaces/base/porter.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
schemaVersion: 1.0.0
name: tre-workspace-base
version: 2.0.0
version: 2.0.1
description: "A base Azure TRE workspace"
dockerfile: Dockerfile.tmpl
registry: azuretre
Expand Down Expand Up @@ -268,17 +268,17 @@ upgrade:
- login
flags:
service-principal: ""
username: '${ bundle.credentials.auth_client_id }'
password: '${ bundle.credentials.auth_client_secret }'
tenant: '${ bundle.credentials.auth_tenant_id }'
username: "${ bundle.credentials.auth_client_id }"
password: "${ bundle.credentials.auth_client_secret }"
tenant: "${ bundle.credentials.auth_tenant_id }"
allow-no-subscriptions: ""
- exec:
description: "Update workspace app redirect urls"
command: ./update_redirect_urls.sh
flags:
workspace-api-client-id: '${ bundle.parameters.client_id }'
aad-redirect-uris-b64: '${ bundle.parameters.aad_redirect_uris }'
register-aad-application: '${ bundle.parameters.register_aad_application }'
workspace-api-client-id: "${ bundle.parameters.client_id }"
aad-redirect-uris-b64: "${ bundle.parameters.aad_redirect_uris }"
register-aad-application: "${ bundle.parameters.register_aad_application }"

uninstall:
- terraform:
Expand Down
15 changes: 15 additions & 0 deletions templates/workspaces/base/terraform/storage.tf
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,21 @@ resource "azurerm_storage_account" "stg" {
infrastructure_encryption_enabled = true

lifecycle { ignore_changes = [infrastructure_encryption_enabled, tags] }

blob_properties {
delete_retention_policy {
days = 7
}
container_delete_retention_policy {
days = 7
}
}

file_properties {
delete_retention_policy {
days = 7
}
}
}

# Using AzAPI as AzureRM uses shared account key for Azure files operations
Expand Down
Loading