cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
agigliotti
Frequent Visitor

Log User to SQL Server

If I create a Powerapp with SQL Server as the datasource/connector, I want to be able to create a trace in the SQL Server Profiler to create a trace on transactions to a certain SQL Server database, which I can do.  However, I want the user to show up in the "LoginName" field of the trace table (or trace file).    However, for PowerApps I have setup the connection to SQL Server using "Basic" authentication instead of "Windows" authentication.  Can I assume that since I use "Basic" authentication, that is the reason why the same user shows up as the "LoginName" in the trace?  This user is a database user I created solely to create this connection.  Can I assume that using "Windows" authentication would allow whatever user is logged into PowerApps to appear as the "LoginName" in the trace file.  Also, would I need to add this windows user as a user in the SQL Server database as well?

1 REPLY 1
v-yutliu-msft
Community Support
Community Support

Hi @agigliotti ,

Firstly, let me explain about the Authentication type of SQL Server.

If you choose Windows Authentication, then you need to fill in data with your windows user account and password.

In this situation, you need to fill in authentication information of the user created in Windows (when you open your computer, the username and password that you need to enter in).

The windows user account format is usually: domain\username

If you choose SQL Server Authentication, then you need to fill in data with your sql server user account and password.

In this situation, you need to fill in authentication information of the user that you create in SQL Server.

 

Secondly, when you create connection with SQL Server in powerapps, firstly you need to choose Authentication type of SQL Server.

You need to fill in authentication information based on the type you entered.

If you choose Windows Authentication, enter windows user information.

If you choose SQL Server Authentication, enter SQL Server user information.

 

Thirdly, answer your questions.

1) Would I need to add this windows user as a user in the SQL Server database as well?

No, you do not need to. Windows user and sql server user are two different types of user.

2)about the  "LoginName" in the trace

If you choose Windows Authentication when you connected with sql server, it will show as windows user name in sql profile when you use this connection.

If you choose SQL Server Authentication when you connected with sql server, it will show as sql user in sql profile when you use this connection.

3310.PNG

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (2,763)