0
votes

I am building a Blazor application and deploying to Azure, first going through a Staging deployment slot.

When you do a slot swap to bring staging into production, from what I have read it works through just a DNS change, so there would be nothing in the running Staging web app triggered to attempt to update the database with the latest migrations.

I'm struggling to understand what I am meant to do with a slot swap, to simultaneously apply the DB migrations. Pulling the website down briefly is no issue, small amounts of downtime are acceptable.

I dont need it to run without me touching anyhting, I can go and kick it off at the same time - my question really, is how?

1

1 Answers

0
votes

I have several .NET Core 2.2 and .NET Core 3.1 applications, using the corresponding EF Core versions, running on Azure.

All of them are deployed via a Staging slot and then swapped to production, and the data migrations are applied every time, as long as the database already exists at least,

In short and based on my experience, you should have no problem; doing a swap should apply the changes to the database.

Have you tried swapping? What has been the result? How/where do you call .Migrate()?