Skip to main content

Notifications

Power Apps Pro Dev & ISV
Answered

Credentials being used when accessing App

Posted on by 38
Hello, I built an app and it works fine for me, but when other use it, they get an error. That is due when they are accessing the app. I have a service account that talk to the SQL database. When they make the connection for the first time to the app, I want them to use those credentials when signing in as well, instead of theirs. BUt it force them to use their. How can I accomplish that?
  • M7r229 Profile Picture
    M7r229 38 on at
    Credentials being used when accessing App
    Thanks, I think this is the solution to my problem. I would had never found that. Thanks.
  • Verified answer
    WarrenBelz Profile Picture
    WarrenBelz 141,122 on at
    Credentials being used when accessing App
    Hi M7r229
    If they have proper licenses for the SQL data source (permissions do not matter, but Multiplexing may apply if they are not licensed) and you are connecting with the Flow (not directly in Power Apps), then you can use the Run only users (one of mine is below where files save to a common OneDrive ) and specify to use the Service Account on the SQL connection.
     
    You will also need to delete the Flow, modify it and then re-connect it to the App.
     
    Please click Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.
    MVP (Business Applications)     Visit my blog Practical Power Apps    Buy me a coffee
  • M7r229 Profile Picture
    M7r229 38 on at
    Credentials being used when accessing App
    Thanks for the response. The motivation is that the users that will be accessing the app, dont have the permissions to talk to the SQL database. They do have the proper license in PowerApp however.. Let me get you a high level of what going on, if they dont have the correct permissions.
     
    Within the power app, I have a power automate flow that set to run. When they fill out the app and gets to a certain point where it have to write to the database, the error in power automate comes up "unauthorized", even though I set the power automate flow itself to use the service account to access the SQL database. Let me know if any of that dont make sense.
  • WarrenBelz Profile Picture
    WarrenBelz 141,122 on at
    Credentials being used when accessing App
    Hi M7r229 
    The function of user authentication is to ensure that the user accessing the data is properly authorised to do so, particularly that they have the correct level licence. Please correct me if I am wrong here, but is your motivation for using the Service Account the fact that the relevant users do not have a Premium Licence ?
    If this is the case, they cannot connect from Power Apps and you also need to read this Multiplexing guide (it is a download) if you are considering connecting by other means. If the users are properly licensed, you will need to do some sort of Power Automate read/write Flow using the Run Only Users function on the connection.
     
    Please click Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.
    MVP (Business Applications)     Visit my blog Practical Power Apps    Buy me a coffee

     
     
     

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

September 2024 Newsletter…

September 2024 Community Newsletter…

Community Update Sept 16…

Power Platform Community Update…

Welcome to the new Power Platform Community!…

We are excited to announce our new Copilot Cookbook Gallery in the Community…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 141,122

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 63,414

Leaderboard