Bootstrapping AdminUI
For AdminUI to work out of the box, it has some behaviour turned on by default that inserts the required data into the OpenIddict, and Identity database tables on the app start if missing. If the user table is empty, this also inserts a default user into the database on the first start-up.
Disabling Bootstrapping
You can disable this functionality in the app's configuration setting DisableBootstrap
to true. Help for configuring AdminUI can be found here.
The bootstrapping in AdminUI is not concurrency safe, so if you were to have multiple instances of AdminUI running, you would need to disable bootstrapping to avoid running into errors when trying to start AdminUI for the first time.
Enforcing Bootstrap
If Bootstrapping is disabled for AdminUI, you can still initiate it by using the RunBootstrapper()
extension method. This also allows you to trigger the bootstrap process from a separate assembly, without needing to launch the entire AdminUI. Here’s an example:
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddAdminUI();
var app = builder.Build();
await app.RunBootstrapper();