0

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?

xinunix
  • 561
  • 4
  • 15

1 Answers1

2

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?

Roman Kiss
  • 7,925
  • 1
  • 8
  • 21
  • Outstanding, thank you that's probably the one thing I didn't try was a different delimiter. Seems like that would be something they need to make a little more clear in the documentation. Comma separated values are pretty common these days, should support that as well. Thanks! – xinunix May 08 '18 at 17:34
  • One more note, after adding it like this: EntityArchivedEvent;EntityHeaderCreatedEvent I discovered that the subscription grid displays it as EntityArchivedEvent,EntityHeaderCreatedEvent using a comma as the delimiter! – xinunix May 08 '18 at 17:38
  • I am expecting very soon a new subscription blade for version 2018-05-01, which is now in the preview. We can hope that this "bug" will be fixed included a Labels and the major problem with the deleting a subscription which stayed for ever in the provisioning state = updating (deadlock situation). – Roman Kiss May 08 '18 at 18:37