question

siebeverschaeve avatar image
19 Votes"
siebeverschaeve asked MayankBargali-MSFT commented

[BUG] Azure Logic Apps - Event Grid

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-appsazure-event-grid
eg-publish.png (22.5 KiB)
eg-subscribe.png (42.0 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

MayankBargali-MSFT avatar image
1 Vote"
MayankBargali-MSFT answered MayankBargali-MSFT commented

@siebeverschaeve 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.

· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@MayankBargali-MSFT thanks! Sounds great to me. Thanks for looking into this specifically!
Is there a way that I could be updated on when this fix would be implemented?

E.g release tag/notes on GitHub or the general update page of MS?

Thank you.

0 Votes 0 ·

@siebeverschaeve I will post an update here once the fix is implemented and deployed by the product team. I am tracking this issue internally with the team.

1 Vote 1 ·