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?