C
C#•4mo ago
Gecko

Run EF Migrations in Azure SQL Database

I made an Azure SQL Database for my blazor application. I'm wondering how to run my EF Migrations so my SQL DB gets seeded with the proper data?
9 Replies
Jimmacle
Jimmacle•4mo ago
either using the ef tools or dbContext.Database.Migrate/MigrateAsync in your program
Gecko
Gecko•4mo ago
When I use ef tools in VS locally, it only applies my migrations to my local db. How do I target the app on azure?
Jimmacle
Jimmacle•4mo ago
EF Core tools reference (.NET CLI) - EF Core
Reference guide for the Entity Framework Core .NET Core CLI tools
Gecko
Gecko•4mo ago
No description
Gecko
Gecko•4mo ago
So I do what the docs say, but it just says "Build succeeded" then stalls. And the build hasn't actually succedded, when I check the db it has none of the tables from the migration
Jimmacle
Jimmacle•4mo ago
the build isn't what does the migration, the migration is run after your program is built if it just sits there i imagine there's a connection issue
Gecko
Gecko•4mo ago
Microsoft.Data.SqlClient.SqlException (0x80131904): Login failed for user 'coldevelopment'. Yep, took forever, but just got that error I'm 100% my userid and password was right though
Jimmacle
Jimmacle•4mo ago
well, the server you're connecting to says otherwise
Gecko
Gecko•4mo ago
💀💀