Entity Framework Azure SQL Server Settings
# help-with-umbraco
a
hello all, I'm having trouble following the entity framework article for Umbraco 12. https://docs.umbraco.com/umbraco-cms/tutorials/getting-started-with-entity-framework-core I've followed steps 1-5 and it seems to work, except for after step 5, the migration fails when it is run: An error occurred starting the application","@l":"Fatal","@x":"System.AggregateException: One or more errors occurred. (One or more errors occurred. (Invalid operation. The connection is closed.))\r\n ---> System.AggregateException: One or more errors occurred. (Invalid operation. The connection is closed.)\r\n ---> System.InvalidOperationException: Invalid operation. The connection is closed.\r\n at Microsoft.Data.SqlClient.SqlCommand.EndExecuteNonQueryAsync(IAsyncResult asyncResult)\r\n at Microsoft.Data.SqlClient.SqlCommand.<>c.b__208_1(IAsyncResult result)\r\n at Here is my startup.cs: //Register EFCore services.AddUmbracoEFCoreContext(_config.GetConnectionString("umbracoDbDSN"), "Microsoft.Data.SqlClient"); I am connecting to an Azure SQL database, and apparently this implementation of Entity Framework cannot connect to it. What am I doing wrong?
e
Hi, I just experienced the same thing, fixed it by using non async methods (Database.GetPendingMigrations(), Database.Migrate())