简体   繁体   中英

Azure Portal: Application Insights - How to Identify Requestor's IP Address

Hello i was wondering if someone could answer this question for me:

Is there a way for me to view logs of incoming requests and their IP Addresses.

Here is the scenario:

We have multiple host machines that every 5 minutes submit data into our .NET Web Application via a simple MVC controller. One of the machine's configuration is pointing to a correct domain, but the wrong controller name.

So every 5 minutes this generates a 404 error on Azure Portal. I would like to identify which machine is configured wrongly by identifying the IP Address of the incoming request that is causing this issue. We are running .NET web application with 12 VM Instances and I have checked the ApplicationInsights/Logs section, but can not find any references to the IP Address.

Any way to track it via Azure Portal site?

Thanks in advance.

As long as the Application Insights .NET or .NET Core SDK is installed and configured on the server to log requests, you can create/update an Application Insights resource on Azure that shows the client's IP address.

You may currently be seeing the IP 0.0.0.0 in logs, which is the default :

This behavior is by design to help avoid unnecessary collection of personal data. Whenever possible, we recommend avoiding the collection of personal data.

From the same article you can see the setting to configure as follows (shortened for brevity).

{
       // ...
       "properties": {
              // ...
              "DisableIpMasking": true
       }
}

After this setting is configured, logs will begin showing with the client ip addresses when queried in Application Insights.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM