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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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