xinunix
xinunix

Reputation: 561

Azure Event Grid specify multiple event types in subscription blade

I have an event grid subscription that I would like to have subscribed to multiple event types. In the event types field if I specify:

EntityArchivedEvent 

and then submit an event with that type the event matches and the associated azure function fires as expected.

However if I attempt to add another event type to the Event Types field as follows:

EntityArchivedEvent,EntityHeaderCreatedEvent

And then I send the exact same event as above of type EntityArchivedEvent now the event fails to match and shows as unmatched in the event subscriptions metrics. Not even trying to get it to match to the new event type yet, just verifying that the original one still works.

According to the spec it appears that Entity Types field is an array and should support multiple values. How do I specify those properly in the portal blade when editing subscriptions?

Upvotes: 0

Views: 410

Answers (1)

Roman Kiss
Roman Kiss

Reputation: 8265

The problem is a delimiter, use a semicolon character (;) as a delimiter of the event types.

I think it should be used a delimiter for array of string such as a comma character (,) Beside that, there is no trimming space, for example:

EntityArchivedEvent    ;    EntityHeaderCreatedEvent

will create an array of the event types:

"includedEventTypes": [
      "EntityArchivedEvent    ",
      "    EntityHeaderCreatedEvent"
    ]

Definitely, this part (implementation of the subscription blade) should be required to fix it such as using a comma delimiter and also trimming whitespaces at the start and end of the each event type.

also I have just find one more "bad coding" for this converting, the following example is showing this case:

    EntityArchivedEvent;EntityHeaderCreatedEvent;


     "includedEventTypes": [
      "EntityArchivedEvent",
      "EntityHeaderCreatedEvent",
      " "
    ]

In this case, we have a whitespace event type, haven't?

Upvotes: 2

Related Questions