Users Pricing

forum

Home Forums How to configure Hangfire with SQL Server and dashboard authorization in ASP.NET Core? – MindStick

How to configure Hangfire with SQL Server and dashboard authorization in ASP.NET Core?

Ravi Vishwakarma 23 17 Sep 2026

I am trying to integrate Hangfire into my ASP.NET Core Web API project for background processing. While basic setup works with memory storage, I need to configure it with SQL Server storage and restrict access to the dashboard.

Setting Up Hangfire Services

Here is my current setup in Program.cs:

// Add Hangfire services to DI container
builder.Services.AddHangfire(config => 
    config.UseSqlServerStorage(builder.Configuration.GetConnectionString("HangfireConnection")));

// Add the processing server
builder.Services.AddHangfireServer();

Restricting Dashboard Access

By default, the Hangfire dashboard is only accessible locally. How can I implement a custom IDashboardAuthorizationFilter to ensure only authorized admin users can view the dashboard in production?

  • What is the recommended approach to extract authenticated claims inside the authorization filter?
  • Are there performance implications when using SQL Server for high-frequency recurring jobs?

0 Answers

Markdown for AI

A clean, structured version of this page for AI assistants and LLMs.

Open .md