Deployments including database tasks — quick notes
Database deployments — quick notes
| Principle | Detail |
|---|---|
| Core rule | Schema must be compatible with old and new app versions during rollout |
| Breaking change pattern | Expand → Migrate → Contract |
| Expand | Add new column; old code unaffected |
| Migrate | Dual-write, backfill |
| Contract | Drop old column only when nothing reads it |
| Azure SQL implementation | SqlAzureDacpacDeployment@1 can publish a reviewed DACPAC by using an Azure service connection |
| Migrations must be | Idempotent, transactional where supported, and protected by a current recovery point plus tested restore |
| Ordering | Express dependencies and conditions at the needed stage, job, or step boundary |
Traps
- A one-step rename is not backward-compatible while old and new versions coexist.
on: failureruns authored steps; an app rollback alone cannot restore dropped schema or data.
Sources: https://learn.microsoft.com/en-us/credentials/certifications/resources/study-guides/az-400 · https://learn.microsoft.com/en-us/azure/devops/pipelines/targets/azure-sqldb · https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/reference/sql-azure-dacpac-deployment-v1 · https://learn.microsoft.com/en-us/azure/aks/zero-downtime-migration · https://learn.microsoft.com/en-us/azure/cloud-adoption-framework/modernize/execute-cloud-modernization · https://learn.microsoft.com/en-us/ef/core/managing-schemas/migrations/applying · https://learn.microsoft.com/en-us/ef/core/managing-schemas/migrations/managing · https://learn.microsoft.com/en-us/azure/devops/pipelines/process/deployment-jobs · https://learn.microsoft.com/en-us/azure/devops/pipelines/process/stages · https://learn.microsoft.com/en-us/azure/well-architected/reliability/reliability-test