question

razi-8355 avatar image
0 Votes"
razi-8355 asked MayankBargali-MSFT answered

Deploying EventGrid Topic with Bicep fails

Following the documentation HERE I created a bicep module that looks like this:

 param topicName string
    
 @description('Specifies the location for the EventGrid topic.')
 param location string = resourceGroup().location
    
 param tags object = {
   Environment: 'None'
   Project: 'None'
 }
    
 @allowed([
   'EventGridSchema'
   'CustomEventSchema'
   'CloudEventSchemaV1_0'
 ])
 param inputSchema string = 'EventGridSchema'
    
 @allowed([
   'Enabled'
   'Disabled'
 ])
 param publicNetworkAccess string = 'Enabled'
    
 resource EventGridTopic 'Microsoft.EventGrid/topics@2020-06-01' = {
   name: topicName
   location: location
   tags: tags
   properties: {
     inputSchema: inputSchema
     publicNetworkAccess: publicNetworkAccess
   }
 }

When calling the module from a test deployment file:

 param topicName string
    
 param location string
    
 param tags object = {
   Environment: 'None'
   Project: 'None'
 }
    
 // param eventSubscriptionList array
    
 module eventGridTopic './../components/eventgrid/eventgrid-topic.bicep' = {
   name: '${tags.Environment}-eventgrid-topic'
   params: {
     topicName: topicName
     location: location
     tags: tags
   }
 }


The deployment fails with the following 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\": \"DeploymentFailed\",\r\n        \"message\": \"At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/DeployOperations for usage details.\",\r\n        \"details\": [\r\n          {\r\n            \"code\": \"Conflict\",\r\n            \"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 1dcd0f90-2ad7-4ac8-821c-dcb4aa3da4ad:8/11/2021 4:21:43 PM (UTC) to our forums for assistance or raise a support ticket .\\\"\\r\\n      }\\r\\n    ]\\r\\n  }\\r\\n}\"\r\n          }\r\n        ]\r\n     
  }\r\n    ]\r\n  }\r\n}"}]}}

I tried validating the object over and over, manually created one and inspected the JSON payload that was sent to the API and I can't wrap my head around what I'm doing wrong.

Can this be checked from your side: 1dcd0f90-2ad7-4ac8-821c-dcb4aa3da4ad:8/11/2021 4:21:43 PM (UTC)

What am I missing?




azure-event-grid
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

MayankBargali-MSFT avatar image
0 Votes"
MayankBargali-MSFT answered

@razi-8355 There was intermittent issue during that time causing this issue while creating the event grid topic. Can you please confirm if you are still observing the same behavior.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.