Skip to main content

Notifications

Community site session details

Community site session details

Session Id : nYaKUFLeI/aFqLZtAxQkZ9
Power Apps - Building Power Apps
Unanswered

Log User to SQL Server

Like (0) ShareShare
ReportReport
Posted on 30 Mar 2020 21:23:40 by

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?

  • v-yutliu-msft Profile Picture
    on 31 Mar 2020 at 07:31:07
    Re: Log User to SQL Server

    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,

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Apps - Building Power Apps

#1
MS.Ragavendar Profile Picture

MS.Ragavendar 32

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 19 Super User 2025 Season 1

#3
Rajkumar_M Profile Picture

Rajkumar_M 16 Super User 2025 Season 1

Overall leaderboard
Loading started