My applications are deployed in Azure Webapps now I would like to capture logon user name, logon access timestamps, Duration, Failed logons...

haribansh gupta 6 Reputation points
2022-05-03T08:03:37.873+00:00

My applications are deployed in Azure Webapps now I would like to capture below details-

Logon user name, logon access timestamps, Duration, Failed logons...

Tried- I have enabled Application Insights in Azure but still I could not able to see those details

What should be the best approach without redeploying the application.
Is there any options in azure portal blade where I can collect ?
Inside- Usages Blade I saw the Users but I can see only user Id not user name.

Azure Monitor
Azure Monitor
An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.
3,366 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,022 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Ryan Hill 29,291 Reputation points Microsoft Employee
    2022-05-03T14:17:19.08+00:00

    Enable diagnostics logging for apps in Azure App Service, specifically sending logs to Azure Monitor, is a doc covering the various methods for capturing logging information. Sending logs to Azure Monitor will allow you to query AppServiceHTTPLogs. Application Insights Auto-instrumentation on the other hand, currently works with select frameworks out of the box and captures certain telemetry. Either method should capture failed requests.

    Having said that, there isn't any feature in the Azure Portal that will allow you to easily collect login information. Since you're specifically looking for logon information, that type logging will be determined by the authentication method you selected. It's possible that the login information isn't in the header and furthermore, that particular header is not captured in the raw web server logs.

    Capturing this information is to log it yourself. I would add console log tracing when a user successfully logs in, logs out, or fails to login. This would require adding the necessary code and redeploying the app. I'm not sure if your concern about not redeploying the app is centered around not being able to alter the code, but this would be the best course of action.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.