---
title: "How to configure Hangfire with SQL Server and dashboard authorization in ASP.NET Core?"  
description: "How to configure Hangfire with SQL Server and dashboard authorization in ASP.NET Core?"  
author: "Ravi Vishwakarma"  
published: 2026-09-17  
updated: 2026-09-17  
canonical: https://www.mindstick.com/forum/162172/how-to-configure-hangfire-with-sql-server-and-dashboard-authorization-in-asp-net-core  
category: "Hangfire"  
tags: ["Hangfire", "ASP.NET Core", "SQL Server Storage", "Dashboard Authorization", "Background Jobs"]  
reading_time: 1 minute  

---

# How to configure Hangfire with SQL Server and dashboard authorization in ASP.NET Core?

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](https://www.mindstick.com/forum/244/sql)** and restrict access to the dashboard.

## Setting Up Hangfire Services

Here is my current setup in `Program.cs`:

```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?


---

Original Source: https://www.mindstick.com/forum/162172/how-to-configure-hangfire-with-sql-server-and-dashboard-authorization-in-asp-net-core

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
