Curl not connecting to Azure Monitor

Bombbe 1,611 Reputation points
2024-05-31T11:30:48.5466667+00:00

Hello,

I am testing a connection from a container to Azure Monitor using curl but all the options I have tried so far have failed. I have confirmed that the connection is fine from my virtual network because I can successfully run tests with PowerShell (ping and test-netconnection) but I cannot figure out why curl is not working.

Can anyone tell me if Azure Monitor can respond to curl requests? Or help me understand what I might be doing wrong? Thank you.

User's image

User's image

Azure Monitor
Azure Monitor
An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.
2,938 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. AnuragSingh-MSFT 20,996 Reputation points
    2024-06-10T08:01:31.0366667+00:00

    @Bombbe, thank you for posting the question and apologies for the delayed response.

    Note that the tools used in the question all have different utilities. Ping/Test-connection only verifies whether the URL is reachable or not. They both use ICMP echo protocol to ensure that the endpoint is reachable. For details, see Test-Connection

    Curl on the other hand, is used for data transfer. In the screenshot shared in the question, the connection does go through with Curl as well (as it says - connected to global...), however there are no authentication or data transfer being done there in the format that endpoint requires. Hence the connection gets reset (Recv failure: Connection was reset). In short, the endpoint only had to do a simple reply back for ping/test-connection which does not involve data transfer. But curl initiated a data transfer protocol (TCP) and because the server did not get the request in required format, it simply resets the connection back.

    Hope this helps.

    If the answer did not help, please add more context/follow-up question for it. Else, if the answer helped, please click Accept answer so that it can help others in the community looking for help on similar topics.

    0 comments No comments