Share via

Can't deploy System event Grid Subscription

Chris Kingdon 21 Reputation points
2021-12-16T00:55:03.033+00:00

I'm trying to deploy a subscription for my system event grid topic in bicep but I'm running into the following error:

ERROR: {"status":"Failed","error":{"code":"DeploymentFailed","message":"At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/DeployOperations for usage details.","details":[{"code":"Conflict","message":"{\r\n \"status\": \"Failed\",\r\n \"error\": {\r\n \"code\": \"ResourceDeploymentFailure\",\r\n \"message\": \"The resource operation completed with terminal provisioning state 'Failed'.\",\r\n \"details\": [\r\n {\r\n \"code\": \"Internal error\",\r\n \"message\": \"The operation failed due to an internal server error. The initial state of the impacted resources (if any) are restored. Please try again in few minutes. If error still persists, report cbed589a-559e-4484-9694-e3ec71dbadfe:12/16/2021 12:50:41 AM (UTC) to our forums for assistance or raise a support ticket .\"\r\n }\r\n ]\r\n }\r\n}"}]}}

I have tried creating a new topic and I'm still having the same issue. Below in my bicep code:

/ System event grid subscriptions
resource datalakeSystemEventGrid 'Microsoft.EventGrid/systemTopics@2020-04-01-preview' existing = {
name: 'evgst-${projectName}-dlspapertracking'
}

resource sendImportCompletedEventSubscription 'Microsoft.EventGrid/systemTopics/eventSubscriptions@2020-04-01-preview' = {
name: 'sendImportCompletedEventSubscription'
parent: datalakeSystemEventGrid
properties: {
destination: {
endpointType: 'AzureFunction'
properties: {
resourceId: '${functionApp.id}/functions/send_import_completed_event'
maxEventsPerBatch: 1
preferredBatchSizeInKilobytes: 64
}
}
filter: {
includedEventTypes: [
'Microsoft.Storage.BlobRenamed'
'Microsoft.Storage.BlobCreated'
]
subjectBeginsWith: '/blobServices/default/containers/machine-data/blobs/CompletedImports'
}
eventDeliverySchema: 'EventGridSchema'
retryPolicy: {
maxDeliveryAttempts: 3
eventTimeToLiveInMinutes: 120
}
}
}

Azure Event Grid
Azure Event Grid

An Azure event routing service designed for high availability, consistent performance, and dynamic scale.

0 comments No comments

1 answer

Sort by: Most helpful
  1. Chris Kingdon 21 Reputation points
    2021-12-16T01:31:25.353+00:00

    So it turns out the issue was that my function app function's trigger was set wrong. I had eventGrid instead of eventGridTrigger as the input type. Switching to the correct binding type and redeploying everything got it working. It would be nice to see a better error message on this though.

    Was this answer helpful?


Your answer

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