📁 Sangam Dhakal - Portfolio v2.0 - Netscape Navigator 4.0
_
□
×

📚 Interview question

How would you run EF Core migrations when deploying a .NET service to Kubernetes with Helm, and how do you keep rollback safe?

Mid-Level Theory Intermediate

🎯 Key points

  • Migration bundle in a pre-upgrade Job or pipeline step
  • Never migrate in every pod's startup
  • Expand and contract migrations
  • Rollback reverts manifests only
  • Separate identity with DDL rights
  • Test migrations in CI against a real SQL Server and review the generated script
  • Monitor the migration Job (logs, activeDeadlineSeconds) and keep a point-in-time restore plan for Azure SQL

⏱ 30-second answer

Run an EF Core migration bundle once per release, as a Helm pre-upgrade hook Job or a pipeline step, never in every pod's startup. Use a dedicated identity with DDL rights. Make migrations backward compatible (expand then contract): add columns as nullable, deploy code that uses them, and drop old columns in a later release. Then helm rollback to the previous version still works against the new schema.

🔍 What the interviewer is checking

Checks they understand schema changes are not rolled back with manifests

↩ Usually asked after

More in Containers

Last updated 23 Nov 2026.

🌐 Sangam's Webring

⏪ Previous 🏠 Main Next ⏩
💬 Chat with me