Hi Guru Pasupathy,
For Consumption Logic Apps the easiest, supported workaround is to use the Logic App workflow callback URL (the full URL that includes the sig SAS token) as the webhook endpointUrl when creating Event Grid subscriptions, rather than trying to use deliveryWithResourceIdentity / managed-identity authentication.
- Logic Apps expose a workflow trigger callback URL that contains a SAS signature (
sig=) and the REST API / CLI / PowerShell can return that URL (listCallbackUrl/Get-AzLogicAppTriggerCallbackUrl).
Why this helps: the callback URL already supplies the secret that the Consumption trigger expects (the sig), so Event Grid can complete the subscription validation and deliver events without an extra auth handshake that may not map cleanly to the Consumption trigger URL format.
Quick Terraform / azapi change (high level)
Replace your deliveryWithResourceIdentity block and identity with a plain webhook endpointUrl set to the workflow callback URL you get from Logic Apps:
# obtain the callback URL (programmatically) and insert it here
locals {
logicapp_callback = "<PUT_YOUR_WORKFLOW_CALLBACK_URL_WITH_SIG_HERE>"
}
resource "azapi_resource" "egns_internal_topic_logicapp_push_subscription" {
type = "Microsoft.EventGrid/namespaces/topics/eventSubscriptions@2025-04-01-preview"
name = "internal-topic-logicapp-sub-msi"
parent_id = "/subscriptions/${var.subscription_id}/resourceGroups/${var.resource_group_name}/providers/Microsoft.EventGrid/namespaces/${var.event_grid_namespace}/topics/internal-topic"
body = {
properties = {
deliveryConfiguration = {
deliveryMode = "Push"
push = {
destination = {
endpointType = "WebHook"
properties = {
endpointUrl = local.logicapp_callback
maxEventsPerBatch = 100
preferredBatchSizeInKilobytes = 64
}
}
eventTimeToLive = "P7D"
maxDeliveryCount = 10
}
}
eventDeliverySchema = "CloudEventSchemaV1_0"
}
}
}
How to get the workflow callback URL programmatically (use in automation)
- REST API:
POST https://management.azure.com/subscriptions/{sub}/resourceGroups/{rg}/providers/Microsoft.Logic/workflows/{workflow}/triggers/{trigger}/listCallbackUrl?api-version=2016-06-01— response containsvalue(the full URL withsig). - or PowerShell:
Get-AzLogicAppTriggerCallbackUrlreturns the trigger callback URL for a Logic App.
When creating multiple subscriptions, script these steps:
- fetch the callback URL for each workflow
- populate the
endpointUrlin your azapi/ARM/Terraform body - create the Event Grid subscription.
This avoids intermittent control-plane validation/auth issues and scales cleanly.
References: