Event Grid deployment is failing for below ARM template with internal server error.
Tried steps that mentioned in this link Event subscription by ARM template for topic with EndpointType as AzureFunction
But still facing the same issue.
ARM Template:
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"appName": {
"type": "string",
"defaultValue": "harshitk-FA",
"metadata": {
"description": "The name of the function app that you wish to create."
}
},
"eventTopicName": {
"type": "String",
"defaultValue": "harshitTopic",
"metadata": {
"description": "Name for the system topic."
}
},
"eventSubName": {
"type": "string",
"defaultValue": "devharshitktest123sub",
"metadata": {
"description": "Name for the Event Grid subscription."
}
},
"functionName": {
"type": "string",
"defaultValue": "ArmFunctionApp",
"metadata": {
"description": "Function to be triggered by event grid topic"
}
},
"location": {
"defaultValue": "[resourceGroup().location]",
"metadata": {
"description": "Location for all resources."
},
"type": "string"
},
"storageAccountName": {
"defaultValue": "harshitarmtest",
"type": "string"
}
},
"variables": {
"functionAppName": "[parameters('appName')]",
"eventTopicName": "[parameters('eventTopicName')]",
"eventSubscriptionName": "[parameters('eventSubName')]",
"eventHandler": "[parameters('functionName')]",
"storageAccountName": "[parameters('storageAccountName')]"
},
"resources": [
{
"type": "Microsoft.EventGrid/systemTopics",
"apiVersion": "2020-04-01-preview",
"name": "[variables('eventTopicName')]",
"location": "[parameters('location')]",
"properties": {
"source": "[resourceId('Microsoft.Storage/storageAccounts',variables('storageAccountName'))]",
"topicType": "Microsoft.Storage.StorageAccounts"
}
},
{
"type": "Microsoft.EventGrid/systemTopics/eventSubscriptions",
"apiVersion": "2020-04-01-preview",
"name": "[concat(variables('eventTopicName'), '/', variables('eventSubscriptionName'))]",
"dependsOn": [
"[resourceId('Microsoft.EventGrid/systemTopics', variables('eventTopicName'))]"
],
"properties": {
"destination": {
"endpointType": "AzureFunction",
"properties": {
//"resourceId": "[concat('/subscriptions/',subscription().subscriptionId,'/resourceGroups/',resourceGroup().name,'/providers/Microsoft.Web/sites/',variables('functionAppName'),'/functions/',variables('eventHandler'))]",
"resourceId": "[resourceId('Microsoft.Web/sites/functions/', variables('functionAppName'), variables('eventHandler'))]",
"maxEventsPerBatch": 10,
"preferredBatchSizeInKilobytes": 64
}
},
"filter": {
"includedEventTypes": [
"Microsoft.Storage.BlobCreated"
]
},
"eventDeliverySchema": "EventGridSchema"
}
}
enter code here
],
"outputs": {}
}
Error Message in powershell:
"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": "Internal error",
"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 XXXXXXXXXXXXXXXXX`enter code here`:11/26/2020 6:01:09 PM (UTC) to our forums for assistance or raise a support ticket ."
}
]
}