I have facing issue on deploying a resources via ARM . I have 2 queries .
Query 1 . Why this below Linked ARM implicitly created Event Grid System Topic This Linked ARM is only used to get trigger URL of azure function { "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "parameters": { "functionAppName": { "type": "String" } }, "variables": { "sitesWebApiVersion": "2016-08-01" }, "resources": [], "outputs": { "triggerUrl": { "type": "String", "value": "[listsecrets(resourceId('Microsoft.Web/sites/functions', parameters('functionAppName'), 'NPEventGridDataProcessor'), variables('sitesWebApiVersion')).trigger_url]" } } }
Query2 In ARM how I create Event Subscription that attach to explicitly created custom Event Topic. As see the below the master ARM code snippet , event subscription attach unwanted to the Event Grid System Topic . But I want to add it on Custom Event Grid topic .
{ "apiVersion": "2020-06-01", "scope": "[format('Microsoft.EventGrid/topics/{0}', variables('eventGridName'))]", "name": "[variables('eventGridSubwebhookName')]", "type": "Microsoft.EventGrid/eventSubscriptions", "tags": { "displayName": "Webhook Subscription" }, "dependsOn": [ "[resourceId('Microsoft.EventGrid/topics/', variables('eventGridName'))]", "[resourceId('Microsoft.Resources/deployments/', variables('hackForGettingTriggerUrl'))]" ], "properties": { "destination": { "endpointType": "WebHook", "properties": { "endpointUrl": "[reference(variables('hackForGettingTriggerUrl')).outputs.triggerUrl.value]" } } } } ]