Base solution for your next web application
Open Closed

How to update database first time on Azure SQL with EF codefirst? #10544


User avatar
0
bofenstein created

Prerequisites What is your product version? ABP 6.3.0 What is your product type (Angular or MVC)? Angular 11.2 What is product framework type (.net framework or .net core)? .net Core If issue related with ABP Framework What is ABP Framework version? abp-zero-template : 10.3.0

  1. I created a database in Azure SQL and took connection string from there and used it in appsettings.json
  2. Now I changed database name in connection string and tried to "update-database" using package manager console. I get time out error as shown below in image.

  1. Database didnt get created the first time but when I try "update-database" again, database gets created.

I am developing a Multitenant based software with dedicated database for each tenant.

Please help.


3 Answer(s)
  • User Avatar
    0
    musa.demir created

    Hi @bofenstein

    You can run *.Migrator to update all databases (Your's and tenants' databases)

  • User Avatar
    0
    bofenstein created

    i tried this but it doesnt work first time. But if i run Migrator 2nd time it works. @musa.demir

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @bofenstein

    The first time database creation might take long time on Azure. You can try to increase the timeout for the connection.