cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (11,070)