Can't create Event Grid namespace event subscription with "push" delivery mode with Bicep

Jesse Huang 0 Reputation points
2024-08-21T12:11:59.8933333+00:00

The question is related to: https://video2.skills-academy.com/en-us/azure/templates/microsoft.eventgrid/namespaces/topics/eventsubscriptions?pivots=deployment-language-bicep

I want to create an event subscription that has "push" as delivery mode. I can't figure out how I'm suppose to do this in a Bicep template. I have however successfully deployed a subscription with "queue" as delivery mode. I am deploying this template with Pulumi. I keep getting this error when I try to deploy:

code="DeploymentFailed"
Details=[{"code":"InvalidRequest","message":"Required property 'properties' not found in JSON. Path '[0]', line 1, position 187."}]


resource topic 'Microsoft.EventGrid/namespaces/topics@2023-12-15-preview' existing = {
  name: '${namespaceName}/${topicName}'
}

resource namespaceTopicSub 'Microsoft.EventGrid/namespaces/topics/eventSubscriptions@2023-12-15-preview' = {
  name: subscriptionName
  parent: topic
  properties: {
    deliveryConfiguration: {
      deliveryMode: 'Push'
      push: {
        deliveryWithResourceIdentity: {
          destination: {
            endpointType: 'EventHub'
            properties: {
              deliveryAttributeMappings: [
                {
                  name: 'eventType'
                  type: 'Dynamic'
                }
              ]
              resourceId: eventHubResourceId
            }
          }
          identity: {
            type: 'SystemAssigned'
          }
        }
        eventTimeToLive: 'P1D'
        maxDeliveryCount: 4   
      }
    }
    eventDeliverySchema: 'CloudEventSchemaV1_0'
  }
}
Azure Event Grid
Azure Event Grid
An Azure event routing service designed for high availability, consistent performance, and dynamic scale.
390 questions
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.