SQL Server WithHealthCheck will wait forever if the database itself does not exists.
Imagine this code:
var db = builder.AddSqlServer("sqlserver")
.WithDataVolume("sqldata")
.AddDatabase("sqldb")
.WithHealthCheck();
var migrator = builder.AddProject<Projects.MigrationService>("migrator")
.WithReference(db)
.WaitFor(db);
The MigrationService will run the migrations and create the database if it does not exist. When WaitFor(db) and WithHealthCheck() is used, the migration service will never start. It looks like there is no valid solution for this except trying to connect to the SQL server without specifying the database name?
var server = der.AddSqlServer("sqlserver");
var db= ...
var migrator = builder.AddProject<Projects.MigrationService>("migrator")
.WithReference(db)
.WaitFor(server);
SQL Server
WithHealthCheck
will wait forever if the database itself does not exists.Imagine this code:
The MigrationService will run the migrations and create the database if it does not exist. When
WaitFor(db)
andWithHealthCheck()
is used, the migration service will never start. It looks like there is no valid solution for this except trying to connect to the SQL server without specifying the database name?