web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Switching Powerapps SQ...
Power Apps
Answered

Switching Powerapps SQL Connector based on the users membership of Azure AD Group

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello, 

 

I want to build a Powerapp where the Enduser has to be inside of a specific AzureAD Group to be allowed to do certain things with data from an AzureSQL Server.

I want the App to login to the AzureSQL Server based on the AzureAD Group the user is in.

The check for the ADGroup & Permissions should happen on the SQL Server itself, not directly in the Powerapp.

So i need an option to switch the Powerapps AzureSQL Login Connection Data based on the AzureAD Group the user is in.

 

Is this possible, if yes, how do i manage to do that?

 

Greetings,

Philip

 

 

Categories:
I have the same question (0)
  • Joel CustomerEffective Profile Picture
    3,224 on at

    This isn't possible--How many databases are we talking about? You could create multiple copies of the app, each connected to a different SQL. Then share the appropriate apps with the appropriate group.

  • Rohit Sharma354 Profile Picture
    Microsoft Employee on at

    Hello,

     

    Please note that when accessing the app, system checks the permissions based on user account, and if there is no connection created earlier, it ask for the consent when loading for the first time. If the app is shared with other users, then they get implicit access to the Azure SQL connector as well:

     

    Screen2.png

     

    Screen1.png

     

    The switch account option is only if you want to access with different user account, not necessary based on which AD group a user is part of.

     

     

     

     

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi, quick update on my end.

     

    Solved this by restricting the users policies on sql level.

    The AzureSQL database administrator seems always be logged in as dbo from powerapps.

    Other users appear as their e-mail so i could easily check if the current user is in a specific AD Group and implement Row Level Security to restrict what specific groups are allowed to see.

    I found this code demo online which really helped me with this:

    https://archive.codeplex.com/?p=rlssamples#RLS-Hospital-BuiltIn-Demo.sql

  • Verified answer
    Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I've got the account switching working by using this https://powerapps.microsoft.com/de-de/blog/general-availability-of-the-azure-ad-sql-server-connector/

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 335 Most Valuable Professional

#2
11manish Profile Picture

11manish 165

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 96 Super User 2026 Season 1

Last 30 days Overall leaderboard