Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

July 28 - August 9 | Final Round of the Power BI Dataviz World Championships. This is your chance. Learn more

Reply
TheracPowBi
Frequent Visitor

Modify connection to database but not datasource

Hello everybody,

I have a database on SQL server and an ASP.NET application that launch a website. In this website, there is a login page where an user can enter his username & password. These credentials are used to connect to SQL server, in which he only has read rights on the database.

Also, I have embed a PowerBi dashboard in my website using the database from SQL server. 

 

What I would like is that, when an user use his credentials in the website, PowerBi will use these new credentials to connect to the same database. 

I want to use this solution because I have a SQL View that filters my data on the user currently connected to SQL server. 

So, when the user connect in my website, the dashboard will appear with only the data that the user is authorized to see.

 

But I don't know if it's possible to modify the connexion to the database, with the same datasource, without using PowerBi desktop.

Is there a way to do it only with ASP.NET ?

 

Thanks and have a nice day.

 

2 REPLIES 2
Anonymous
Not applicable

Hi @TheracPowBi ,

 

I found the following official document about restricting users with ASP.NET. This article describes how to control authorization for both of these ASP.NET authentication methods. Please refer to

Restrict users from accessing to web resources - ASP.NET | Microsoft Docs

 

And also there's a similar post:

how to restrict user from accessing page in asp

 

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

AlexisOlson
Super User
Super User

I don't have a direct answer but I wanted to point you at the Row Level Security documentation in case you weren't yet aware of it since I'd expect a solution to involve RLS:

https://docs.microsoft.com/en-us/power-bi/create-reports/desktop-rls

Helpful resources

Announcements
Fabric Community Sticker Design Challenge Barcelona Carousel

Fabric Community Sticker Challenge - Barcelona 2026

If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!

July Power BI Update Carousel

Power BI Monthly Update - July 2026

Check out the July 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.