azurerm_eventgrid_event_subscription cost estimation
A subscription that routes filtered events from a topic or Azure source to a handler. The subscription is free to define. Cost lives in Event Grid operations and in the downstream handler it invokes.
The azurerm_eventgrid_event_subscription resource wires an event source (a system topic, custom topic, domain, or an Azure resource like a Storage account) to a handler such as an Azure Function, Event Hub, Service Bus queue, webhook, or Storage queue. Creating the subscription and its filters costs nothing directly. Event Grid does not bill per subscription.
Event Grid bills per operation. The first 100,000 operations per month are free, and beyond that operations are about $0.60 per million. An operation is counted for event ingress, each advanced-filter match evaluation, each delivery attempt, and each dead-letter event. Because a single event can generate multiple operations (ingress plus delivery, plus retries on failure), a high-volume source with flaky handlers can multiply operations well past the raw event count. At $0.60 per million the Event Grid line is usually small, but retries against a failing endpoint can inflate it.
The larger cost sits downstream, in whatever the subscription delivers to. If the handler is an Azure Function, you pay Functions execution and, on a Consumption plan, per-million executions and GB-seconds. If it is Event Hubs or Service Bus, you pay that service's throughput and operations. If it is a webhook to a service that egresses data, you pay egress. The subscription is free, but it is a fan-out trigger that starts metered work in another service on every matching event.
The cost-adjacent gotcha is filtering and dead-lettering. Subscribe without subject or advanced filters and every event fans out to your handler, driving both Event Grid delivery operations and downstream execution for events you did not want. And if you enable dead-lettering to a Storage account, failed events accumulate there as billable blob storage plus the operations to write them. Filter tightly at the subscription so you only pay to deliver events the handler actually needs.
c3x flags azurerm_eventgrid_event_subscription as free and attributes operation cost to Event Grid and execution cost to the handler it targets.
Terraform example
A minimal but realistic configuration that C3X can estimate.
resource "azurerm_eventgrid_system_topic" "storage" {
name = "blob-events"
resource_group_name = azurerm_resource_group.main.name
location = "eastus"
source_arm_resource_id = azurerm_storage_account.main.id
topic_type = "Microsoft.Storage.StorageAccounts"
}
resource "azurerm_eventgrid_event_subscription" "on_blob_created" {
name = "on-blob-created"
scope = azurerm_storage_account.main.id
included_event_types = ["Microsoft.Storage.BlobCreated"]
subject_filter {
subject_begins_with = "/blobServices/default/containers/uploads/"
}
azure_function_endpoint {
function_id = azurerm_function_app_function.processor.id
}
retry_policy {
max_delivery_attempts = 10
event_time_to_live = 60
}
}Pricing dimensions
What you actually pay for when you provision azurerm_eventgrid_event_subscription.
| Dimension | Unit | What's being charged |
|---|---|---|
| Event subscription | free | Defining the subscription and its filters carries no per-resource charge. $0 (free) |
| Event Grid operations (free tier) | per month | The first 100,000 operations each month are free across ingress, filtering, delivery, and dead-lettering. $0 for first 100,000 operations |
| Event Grid operations (beyond free) | per million operations | Operations past the free allowance. A single event can produce several operations across ingress and delivery attempts. about $0.60 per million operations |
| Downstream handler | varies | The Function, Event Hub, Service Bus, or webhook the subscription delivers to bills its own execution, throughput, or egress. depends on the handler |
Optimization tips
Common ways to reduce azurerm_eventgrid_event_subscription cost without changing the workload.
Filter tightly at the subscription
Use included_event_types, subject filters, and advanced filters so only relevant events fan out. Every delivered event costs an Event Grid delivery operation plus downstream execution, so unfiltered subscriptions pay to process noise.
Fix failing handlers to stop retry inflation
Each delivery retry against a failing endpoint counts as another operation. A high max_delivery_attempts against a broken handler multiplies Event Grid operations. Monitor delivery failures and fix or dead-letter fast.
Prune the dead-letter destination
Dead-lettered events land in a Storage account as billable blobs and each write is an operation. Set a lifecycle policy on the dead-letter container so failed events do not accumulate storage cost indefinitely.
Batch to Event Hubs for very high volume
For extremely high event rates, delivering to Event Hubs and processing in batches can be cheaper end to end than triggering a per-event Function on a Consumption plan, where per-execution cost dominates.
FAQ
Is an Event Grid subscription free?
Defining it is free, and the first 100,000 Event Grid operations each month are free. Beyond that, operations cost about $0.60 per million. You also pay for whatever the subscription delivers to, such as a Function or Event Hub.
What counts as an Event Grid operation?
Event ingress, advanced-filter evaluations, each delivery attempt, and each dead-letter event all count. Because one event can trigger ingress plus one or more delivery attempts, a single event often maps to several billed operations.
Where does the real cost of a subscription come from?
Usually the downstream handler. The subscription itself is a cheap fan-out trigger, but each delivered event starts metered work in a Function, Event Hub, Service Bus, or external endpoint. Tight filtering keeps that downstream volume down.
Do retries cost money?
Yes. Each retry is another delivery operation. A subscription with a high retry count pointed at a failing handler can multiply Event Grid operations quickly, so it pays to detect and fix delivery failures.
Related resources
Estimate this resource in your own Terraform
Free, open source, no API key. C3X parses your Terraform and shows line-item cost for every resource, including azurerm_eventgrid_event_subscription.