Share via

Application insight rest api

sivabalan 0 Reputation points
2024-11-21T17:07:15.24+00:00

Hi,

I want to send the event data to application insight using RestAPI, i don't want to use programming language rather use pure RestAPI approach.

Based on my research i see following endpoint works well but want to know is it officially supported.

can you please let me know on this?

curl --location 'https://XXXXXX.applicationinsights.azure.com/v2/track' \
--header 'Content-Type: application/json' \
--header 'x-api-key: XXXXXX415dmjhewu3' \
--data '{
  "name": "Microsoft.ApplicationInsights.Event",
  "time": "2024-11-20T12:34:56.789Z",
    "iKey": "XXXXXX-8d727737eddf",
  "tags": {
    "ai.cloud.role": "my-service",
    "ai.operation.name": "my-operation"
  },
  "data": {
    "baseType": "EventData",
    "baseData": {
      "ver": 2,
      "name": "MyCustomEvent",
      "properties": {
        "CustomProperty1": "Value1",
        "CustomProperty2": "Value2"
      }
    }
  }
}'
Azure Monitor
Azure Monitor

An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.


1 answer

Sort by: Most helpful
  1. Vinodh247 41,966 Reputation points MVP Volunteer Moderator
    2024-11-23T10:23:31.8666667+00:00

    Hi ,

    Thanks for reaching out to Microsoft Q&A.

    Yes, you can send custom event data to Azure Application Insights using the officially supported REST API without requiring any programming language. This is achieved via the v2/track endpoint, which allows you to ingest telemetry data through simple HTTP requests.

    Ingestion endpoint

    https://<resource>.applicationinsights.azure.com/v2/track

    Replace <resource> with your Application Insights resource name.

    Is This Officially Supported?

    Yes, the v2/track endpoint is officially supported by Azure Application Insights for sending telemetry data, including custom events. The use of the x-api-key header for authentication aligns with the Azure documentation.

    Please feel free to click the 'Upvote' (Thumbs-up) button and 'Accept as Answer'. This helps the community by allowing others with similar queries to easily find the solution.

    2 people found this answer helpful.

Your answer

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