@VenkateshDodda-MSFT
we ran azure functions on containerapps for the Eventgrid using below bicep. it worked well as you suggested above. But now MSFT recommends transferring to the native Functionsapp on containerapps.
param name string
param systemTopicName string
param functionAppName string
resource systemTopic 'Microsoft.EventGrid/systemTopics@2024-12-15-preview' existing = {
name: systemTopicName
}
resource EventSubscription 'Microsoft.EventGrid/systemTopics/eventSubscriptions@2024-12-15-preview' = {
name: '${name}-subscription'
parent: systemTopic
properties: {
destination: {
endpointType: 'AzureFunction'
properties: {
resourceId:resourceId('Microsoft.Web/sites/functions',functionAppName, 'myblobtrigger')
maxEventsPerBatch: 1
preferredBatchSizeInKilobytes: 64
}
}
eventDeliverySchema: 'EventGridSchema'
filter: {
includedEventTypes: [
'Microsoft.Storage.BlobCreated'
'Microsoft.Storage.BlobDeleted'
]
isSubjectCaseSensitive: false
}
retryPolicy: {
eventTimeToLiveInMinutes: 1440
maxDeliveryAttempts: 30
}
}
}
new bicep eventgrid sub>
param name string
param systemTopicName string
param functionAppName string
param storageAccountName string
resource systemTopic 'Microsoft.EventGrid/systemTopics@2025-04-01-preview' existing = {
name: systemTopicName
}
resource EventSubscription 'Microsoft.EventGrid/systemTopics/eventSubscriptions@2025-04-01-preview' = {
name: '${name}-subscription'
parent: systemTopic
properties: {
destination: {
endpointType: 'AzureFunction'
properties: {
resourceId: '${resourceId('Microsoft.App/containerApps', functionAppName)}/functions/myblobtrigger'
maxEventsPerBatch: 1
preferredBatchSizeInKilobytes: 64
}
}
eventDeliverySchema: 'CloudEventSchemaV1_0'
filter: {
includedEventTypes: [
'Microsoft.Storage.BlobCreated'
'Microsoft.Storage.BlobDeleted'
]
isSubjectCaseSensitive: false
subjectBeginsWith: '/blobServices/default/containers/in/'
}
retryPolicy: {
eventTimeToLiveInMinutes: 1440
maxDeliveryAttempts: 30
}
deadLetterDestination: {
endpointType: 'StorageBlob'
properties: {
resourceId: resourceId('Microsoft.Storage/storageAccounts/blobServices/containers', storageAccountName, 'default', 'deadletter')
blobContainerName: 'deadletter'
}
}
}
}
Bash(az eventgrid system-topic event-subscription create \
--name blop-trigger-subscription \…)
⎿ Error: ERROR: unrecognized arguments: --azure-function-resource-id /subscriptions/041e3b12-1c32-468a-8386-53833397e791/resourceGroups/rg-lentinis-cms/provide
rs/Microsoft.App/containerApps/lentinis-cms-dvpc56-fn/functions/myblobtrigger
Examples from AI knowledge base:
az eventgrid system-topic event-subscription create --endpoint
/subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.Web/sites/{functionappname}/functions/{functionname} --endpoint-type webhook
--included-event-types Microsoft.Storage.BlobCreated Microsoft.Storage.BlobDeleted --name es1 --resource-group rg1 --system-topic-name systemtopic1
Create a new event subscription for a system topic (autogenerated)
az eventgrid system-topic event-subscription create --endpoint
/subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.Web/sites/{functionappname}/functions/{functionname} --endpoint-type webhook
--event-delivery-schema eventgridschema --included-event-types Microsoft.Storage.BlobCreated Microsoft.Storage.BlobDeleted --name es1 --resource-group rg1
--system-topic-name systemtopic1
Create a new event subscription for a system topic (autogenerated)
https://docs.microsoft.com/en-US/cli/azure/eventgrid/system-topic/event-subscription#az_eventgrid_system_topic_event_subscription_create This confirms that while Container Apps supports kind: functionapp and can run Functions code, the Azure ARM API doesn't yet expose individual functions as sub-resources under Container Apps. This explains why EventGrid can't validate the resource ID.
Can you confirm this?:
Status: The EventGrid service itself hasn't been updated to support Container Apps with native Functions, even though Container Apps can run Functions code.
At this point, our options are:
- Use webhook endpoint type with manual validation - Convert to HTTP trigger that handles EventGrid validation
- Use blob storage triggers directly - Skip EventGrid entirely
- File a feature request/support ticket with Microsoft about EventGrid + Container Apps native Functions integration
- Wait for the integration to be completed - This appears to be a work-in-progress
Thank you.