Troubleshoot Azure Event Grid issues

This article provides information that helps you with troubleshooting Azure Event Grid issues.

Azure Event Grid status in a region

You can view status of Event Grid in a particular region using the Azure status dashboard.

Diagnostic logs

Enable diagnostic settings for Event Grid topics or domains to capture and view publish and delivery failure logs. For more information, see Diagnostic logs.

Metrics

You can view metrics for Event Grid topics and subscriptions, and create alerts on them. For more information, see Event Grid metrics.

Alerts

Create alerts on Azure Event Grid metrics and activity log operations. For more information, see Alerts on Event Grid metrics and activity logs.

Subscription validation issues

During event subscription creation, you may receive an error message that says the validation of the provided endpoint failed. For troubleshooting subscription validation issues, see Troubleshoot Event Grid subscription validations.

Network connectivity issues

There are various reasons for client applications not able to connect to an Event Grid topic/domain. The connectivity issues that you experience may be permanent or transient. To learn how to resolve these issues, see Troubleshoot connectivity issues.

Error codes

If you receive error messages with error codes like 400, 409, and 403, see Troubleshoot Event Grid errors.

Distributed tracing

The Event Grid libraries in .NET, Java, Python, and JavaScript support distributing tracing. To adhere to the CloudEvents specification's guidance on distributing tracing, the library sets the traceparent and tracestate attributes of a CloudEvent extension when distributed tracing is enabled.

To learn more about how to enable distributed tracing in your application, see the Azure SDK distributed tracing documentation:

To enable end-to-end tracing for an Azure Event Hubs or Azure Service Bus Event Grid subscription, configure custom delivery properties to forward the traceparent CloudEvent extension attribute to the Diagnostic-Id AMQP application property.

Here's an example of a subscription that has tracing delivery properties configured for Event Hubs:

az eventgrid event-subscription create --name <event-grid-subscription-name> \
    --source-resource-id <event-grid-resource-id>
    --endpoint-type eventhub \
    --endpoint <event-hubs-endpoint> \
    --delivery-attribute-mapping Diagnostic-Id dynamic traceparent

Azure Functions supports distributed tracing with Azure Monitor, which includes built-in tracing of executions and bindings, performance monitoring, and more.

Microsoft.Azure.WebJobs.Extensions.EventGrid package version 3.1.0 or later enables correlation for CloudEvents between producer calls and Functions Event Grid trigger executions. For more information, see Distributed tracing with Azure Functions and Event Grid triggers.

Sample

See the Line Counter sample. This sample app illustrates using Storage, Event Hubs, and Event Grid clients along with ASP.NET Core integration, distributed tracing, and hosted services. It allows users to upload a file to a blob, which triggers an Event Hubs event containing the file name. The Event Hubs Processor receives the event, and then the app downloads the blob and counts the number of lines in the file. The app displays a link to a page containing the line count. When the link is clicked, a CloudEvent containing the name of the file is published using Event Grid.

Next steps

If you need more help, post your issue in the Stack Overflow forum or open a support ticket.