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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! 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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.