# Delay dashboard initialization

**URL:** <https://discuss.hangfire.io/t/delay-dashboard-initialization/11117>\
**Category:** question\
**Tags:** dashboard\
**Created:** [January 14, 2025, 2:45pm UTC](https://discuss.hangfire.io/t/delay-dashboard-initialization/11117 "2025-01-14T14:45:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ahe](https://avatars.discourse-cdn.com/v4/letter/a/e19b73/32.png) [@ahe](https://discuss.hangfire.io/u/ahe)\
**Post date:** [January 14, 2025, 2:45pm UTC](https://discuss.hangfire.io/t/delay-dashboard-initialization/11117/1 "2025-01-14T14:45:03Z")

</div>

Hello!

Setting up the dashboard in an [ASP.NET](http://ASP.NET) Core application works with `app.UseHangfireDashboard()`. This requires Hangfire to be set up properly and the database to be accessible.

My application with Hangfire runs in Kubernetes and I want to implement the readiness probe. The condition for this probe is that the service can be started and is available independent of external required services, like the database. In short, starting the service without database should work. But `UseHangfireDashboard()` requires the database to be there.

Is there a way to defer the initialization until a check says, that the database is there?

I tried with a startup service. But the general issue is that when I pass the `WebApplication` instance to it I can run `app.UseHangfireDashboard()`, but it has no effect. Most likely because the application is already running and the change has no effect.

Using middleware or host application fails with not being able to inject the `IApplicationBuilder`.

Any help or hints into the right direction are very much appreciated - thanks!
