Azure / azure-quickstart-templates

Azure Quickstart Templates
https://aka.ms/azqst
MIT License
14.07k stars 16.13k forks source link

Eventgrid subscription #11250

Open ThDoor opened 3 years ago

ThDoor commented 3 years ago

eventsubscriptions

Issue Details

Given you are creating an eventgrid subscription of type Web hook, how can i set custom delivery properties (static header) on the event grid subscription in arm or bicep?

sundara20 commented 3 years ago

I too would like to know the same, currently, it seems that this can be done only on the portal.

sundara20 commented 3 years ago

Try this in the ARM template, it worked for me.

{
      "type": "Microsoft.EventGrid/eventSubscriptions",
      "apiVersion": "2020-10-15-preview",
      "name": "[parameters('eventGridSubscriptionName')]",
      "properties": {
        "destination": {
          "endpointType": "WebHook",
          "properties": {
            "endpointUrl": "[parameters('eventGridSubscriptionUrl')]",
            "deliveryAttributeMappings":[
              {
                 "name":"abc",
                 "type":"Static",
                 "properties":{
                    "value":"xyz",
                    "isSecret":false
                 }
              }
           ]

          }
        },

        "filter": {
            "isSubjectCaseSensitive": false
        }
      }
    }