Skip to content

Latest commit

 

History

History
53 lines (40 loc) · 3.35 KB

File metadata and controls

53 lines (40 loc) · 3.35 KB
title description ms.reviewer ms.topic ms.date
current_principal_details()
Learn how to use the current_principal_details() function to return the details of the principal running the query.
alexans
reference
11/03/2024

current_principal_details()

[!INCLUDE applies] [!INCLUDE fabric] [!INCLUDE azure-data-explorer] [!INCLUDE monitor] [!INCLUDE sentinel]

Provides details of the principal running the query.

Syntax

current_principal_details()

[!INCLUDE syntax-conventions-note]

Returns

Returns the details of the current principal as a dynamic. The following table describes the returned fields.

Field Description
UserPrincipalName The sign-in identifier for users. For more information, see UPN.
IdentityProvider The source that validates the identity of the principal.
Authority The Microsoft Entra tenant ID.
Mfa Indicates the use of multifactor authentication. For more information, see Access token claims reference.
Type The category of the principal: aaduser, aadapp, or aadgroup.
DisplayName The user-friendly name for the principal that is displayed in the UI.
ObjectId The Microsoft Entra object ID for the principal.
FQN The Fully Qualified Name (FQN) of the principal. Valuable for security role management commands. For more information, see Referencing security principals.
Country The user's country or region. This property is returned if the information is present. The value is a standard two-letter country or region code, for example, FR, JP, and SZ.
TenantCountry The resource tenant's country or region, set at a tenant level by an admin. This property is returned if the information is present. The value is a standard two-letter country or region code, for example, FR, JP, and SZ.
TenantRegion The region of the resource tenant. This property is returned if the information is present. The value is a standard two-letter country or region code, for example, FR, JP, and SZ.

Examples

:::moniker range="azure-data-explorer"

[!div class="nextstepaction"] Run the query ::: moniker-end

print details=current_principal_details()

Output

details
{
"Country": "DE",
"TenantCountry": "US",
"TenantRegion": "WW",
"UserPrincipalName": "user@fabrikam.com",
"IdentityProvider": "https://sts.windows.net",
"Authority": "aaaabbbb-0000-cccc-1111-dddd2222eeee",
"Mfa": "True",
"Type": "AadUser",
"DisplayName": "James Smith (upn: user@fabrikam.com)",
"ObjectId": "aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb",
"FQN": null,
"Notes": null
}