[BUG] Azure Logic Apps - Event Grid

Siebe Verschaeve 246 Reputation points
2021-09-30T18:38:30.87+00:00

Intro

Hi all,

After logging the same issue on the Azure API Management side, and it having been fixed by their team I've noticed that this is still also an issue on the event grid connector on logic apps. I can't speak for the .NET SDK but that's a whole different story.

Before we start I want to raise that for this bug I'm specifically pointing to the "data" part of the payload in the event grid events.
I saw multiple other issues about DateTime formatting for event times but those pointed to the envelope and not the essential data part.
What might also be important is that the publisher and subscriber logic apps are both multi-tenant LA's. (would advise to also test single tenant)

Issue
When publishing an event to the event grid that contains a DateTime in the following format {"timestamp": "2020-06-19T12:54:40.180Z"} the trailing 0 milliseconds are being truncated/trimmed unexpectedly. After looking at the @azure/eventgrid package documentation I've realized that there's probably also in the LA connector ongoing DateTime formatting (maybe the EventGridDeserializer options ?), I'm unsure whether that's happening when publishing the event or when receiving it when a resource event occurs.

Example of unexpected formatting that happens.

  • 2020-06-19T12:54:40.180Z becomes 2020-06-19T12:54:40.18Z
  • 2020-06-19T12:54:40.100Z becomes 2020-06-19T12:54:40.1Z
  • 2020-06-19T12:54:40.000Z becomes 2020-06-19T12:54:40Z

Event grid JSON Input + Output example
136628-eg-publish.png

{  
    "id": "4244060f-5d50-4ab9-8b22-e9ce5052c00a",  
    "eventType": "CLIENT.PROJECT.ENTITY.CHANGED",  
    "subject": "TEST",  
    "data": {  
        "test": "2021-09-30T09:13:56.000Z"  
    }  
}  

After receiving this event in the connector "When a resource event occurs" of the logic app we see the following.
136772-eg-subscribe.png

{  
    "data": {  
        "test": "2019-03-15T09:13:56Z"  
    },  
    "eventType": "CLIENT.PROJECT.ENTITY.CHANGED",  
    "id": "4244060f-5d50-4ab9-8b22-e9ce5052c00a",  
    "subject": "TEST",  
    "dataVersion": "",  
    "metadataVersion": "1",  
    "eventTime": "2021-09-30T17:31:57.9825801Z",  
    "topic": "/subscriptions/------------/resourceGroups/rg-Sandbox-SiebeVerschaeve/providers/Microsoft.EventGrid/topics/eg-sandbox-siebe"  
}  

There's a clear truncation ongoing on the retrieval of the event.

Our project applies a strict format yyyy-MM-dd'T'HH:mm:ss.SSS'Z' so none of our implementations expect missing milliseconds nor do our 3rd parties when we forward events.

Can someone give me some insights either on how to resolve it or confirm this is a bug?

A special thanks to @MayankBargali-MSFT for letting me tag him in on this issue as well after the resolution of the previous post.
Thanks to all from the community for participating in this thread as well.

If additional information is required from my side, feel free to request.

Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
2,859 questions
Azure Event Grid
Azure Event Grid
An Azure event routing service designed for high availability, consistent performance, and dynamic scale.
319 questions
0 comments No comments
{count} votes

Accepted answer
  1. MayankBargali-MSFT 68,656 Reputation points
    2021-10-04T06:43:54.487+00:00

    @Siebe Verschaeve Thanks for reaching out. The trailing zero are only truncated when we send the events to event grid using the Publish Event action. When I send the event using event grid REST API then I couldn't observe the same behavior. I have reached out to my team and will keep you posted.

    Update 10/13
    I have got an update from my team that they will implement the necessary changes in the Publish Event action but unfortunately right now I don't have any ETA for the fix.
    As the workaround, I will suggest you to use the Publish Events REST API passing the aeg-sas-key HTTP header to authenticate the request using Native HTTP connector.

    Feel free to get back to me if you need any help in implementing the workaround.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful