Azure Communication Services as an Azure Event Grid source
Article
Azure Communication Services integrates with Azure Event Grid to deliver real-time event notifications in a reliable, scalable, and secure manner. The purpose of this article is to help you configure your applications to listen to Communication Services events. For example, you might want to update a database, create a work item and deliver a push notification whenever an SMS message is received by a phone number associated with your Communication Services resource.
Azure Event Grid is a fully managed event routing service, which uses a publish-subscribe model. Event Grid has built-in support for Azure services like Azure Functions and Azure Logic Apps. It can deliver event alerts to non-Azure services using webhooks. For a complete list of the event handlers that Event Grid supports, see An introduction to Azure Event Grid.
You can use the Azure portal or Azure CLI to subscribe to events emitted by your Communication Services resource.
Event subjects
The subject field of all Communication Services events identifies the user, phone number, or entity that is targeted by the event. Common prefixes are used to allow simple Event Grid filtering.
Subject Prefix
Communication Service Entity
phonenumber/
PSTN phone number
user/
Communication Services User
thread/
Chat thread.
The following example shows a filter for all SMS messages and delivery reports sent to all 555 area code phone numbers owned by a Communication Services resource: