Trying to create a new tenant in azure fails, it just times out, sometimes it creates the database but does not seed the data, also the new tenant record is not created in the tenants table.
3 Answer(s)
-
0
hi pablotola
Are there any error logs of the application?
-
0
Thanks for the reply, I found what the error was and it's fixed, had to increase the CommandTimeout and that solved the problem.
On another note I would like to override or replace the function that creates the tenant database and need some guidance. I need to create thne tenant databases in an Azure elastic pool.
I think this is the function that creates and seeds the data:
//Create tenant database _abpZeroDbMigrator.CreateOrMigrateForTenant(tenant);
I was thinking about two options:
- Create the database before this method and keep the method to take care of the seeding.
- Override / Replace the method and code my own.
What would you recommend? How will I be able to run the following command at this point:
CREATE DATABASE DemoDB ( SERVICE_OBJECTIVE = ELASTIC_POOL ( name = DemoPool ) ) ;
Thanks for your help.
-
0
Hi,
You can inject
IDbContextProvider
, get a DbContext and execute SQL commands like below;context.Database.ExecuteSqlRawAsync
orDatabase.ExecuteSqlRaw