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?
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 AppsBuy me a coffee
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.
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 AppsBuy 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.