Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

2.1. Send us required information
2.2. Validate subscription
2.3. Receive audit events
2.4 Example Cloudevents subscriber

3. Handling Cloudevents

3.1 Types
3.2 Data fields
3.3 Handle incorrect messages

...

Response code for a successfull delivery must be one of 200, 201, 202, 203 or 204. A response code of 400, 401, 403, 404 and 413 will stop retries and put the event in our dead-letter event storage. Other failure codes will be retried as described above. If repeated failures occurs during a short time, all deliveries to the endpoint may be suspended for up to several hours.

2.4. Example Cloudevents subscriber

An example implementation of a Cloudevents subscriber can be found here; https://github.com/BankIDNorge/example-cloudevent-subscriber

It is written in Typescript for Azure Functions.

3. Handling Cloudevents

A reworked example request from the Cloudevents documentation can be seen here:

...

  1. Create an Azure AD app for your Webhook.
  2. Create a service principal for Microsoft.EventGrid if it doesn't already exist.
  3. Create a role named AzureEventGridSecureWebhookSubscriber in the Azure AD app for your Webhook.
  4. Create a service principal for the our event subscription writer app if it doesn't already exist.
  5. Add service principal of event subscription writer Azure AD app to the AzureEventGridSecureWebhookSubscriber role
  6. Add service principal of Microsoft.EventGrid to the AzureEventGridSecureWebhookSubscriber role as well

Link to source for these steps: Secure WebHook delivery with Azure AD Application in Azure Event Grid
Note that the link also contains a Powershell script which can perform the setup. For step 4, and the eventSubscriptionWriterAppId variable, you'll need the relevant applicationID from us, which will be provided on request.

We have one app for test and one for production, so some or all of the steps will have to be duplicated depending on your setup. If you decide on creating one Azure AD App for the webhook in each environment, all but the second step will have to be duplicated. If you go for just one Azure AD App, only step 4 and 5 will have to be duplicated. appId for the two apps will be provided to you on request.

...