Application insights failing with invalid instrumenation key, even after providing right key

Vignesh Sukumar 56 Reputation points Microsoft Employee
2024-03-26T09:02:44.58+00:00

Hi I wanted to push custom events to application insights via REST API from logicapp. Please guide on the right approach

URL : https://<<App insight ingestion url>>/v2/track

Header: x-api-key: <<GUID>>

Operation: POST

I am receiving 400 bad request app insights as below

I also tried with managed identity enabled approach, that as well giving the same error. Please guide on the same

{  "itemsReceived": 1,  "itemsAccepted": 0,  "appId": null,  "errors": [    {      "index": 0,      "statusCode": 400,      "message": "Invalid instrumentation key"    }  ]}
Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
3,551 questions
{count} votes

2 answers

Sort by: Most helpful
  1. MayankBargali-MSFT 70,941 Reputation points Moderator
    2024-03-27T03:14:28.0166667+00:00

    @Vignesh Sukumar As per the error it doesn't look like authentication issue rather the request that you are passing is not correctly formed. In case the issue is resolved with the help of Ben then feel free to post as answer so it can help other community member facing the similar issue.

    1 person found this answer helpful.
    0 comments No comments

  2. Vignesh Sukumar 56 Reputation points Microsoft Employee
    2024-04-12T03:32:40.4233333+00:00

    Able to resolve this issue by adding the ikey in the payload, not just in Headers.

    0 comments No comments

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.