You are developing a Windows console application that uses a third-party C++ library. The console application is designed to be run as an Azure WebJob that has authentication and authorization enabled.
You need to ensure that the console application can determine the current user identity.
What should you do?

A.
Perform an HTTP request to the /.auth/me endpoint.
B.
Call the System.Security.Principal.WindowsIdentity.GetCurrent() method.
C.
Read the X-MS-CLIENT-PRINCIPAL-NAME header.
D.
Read the identity from the UserName environment variable.
https://github.com/MicrosoftDocs/azure-docs/blob/master/articles/app-service/app-service-authentication-overview.md
0
0
Answer is a…
https://docs.microsoft.com/en-us/azure/app-service/app-service-web-tutorial-auth-aad
0
2
You could get the username and id from the header,
Performing a HTTP request to /.auth/me is also possible, but not required.
I would stick with C
https://docs.microsoft.com/en-us/azure/app-service/app-service-authentication-how-to#access-user-claims
0
0
The Azure WebJob already has authentication and authorization enabled so option A is not needed. The X-MS-CLIENT-PRINCIPAL-NAME value can be read from the ClaimsPrincipal.
0
0
My answer would also be C.
0
0