Bemærk
Adgang til denne side kræver godkendelse. Du kan prøve at logge på eller ændre mapper.
Adgang til denne side kræver godkendelse. Du kan prøve at ændre mapper.
An event subscription defines how a consumer receives events published to a namespace topic. This article shows you how to create, view, and manage event subscriptions to namespace topics in Azure Event Grid by using the Azure portal.
When you create an event subscription, you choose either pull or push delivery. With pull delivery, your application connects to Event Grid to read events at its own pace. With push delivery, Event Grid sends events to a destination that you configure. To learn more about these options, see Pull delivery overview and Push delivery overview.
Prerequisites
- An Azure account with an active subscription. Create an account for free.
- An Event Grid namespace. To create one, see Create, view, and manage namespaces.
- A namespace topic in your Event Grid namespace. To create one, see Create, view, and manage namespace topics.
Create an event subscription in a namespace topic
In the Azure portal, go to the namespace topic that you want to use for the event subscription. For steps to locate a topic, see Create, view, and manage namespace topics.
In the Entities section, select Subscriptions.
On the Subscriptions page, select + Subscription.
On the Basics tab, enter a name for the event subscription, and then select the delivery mode.
Important
When you create a subscription, choose either the Pull or Push delivery mode. To learn more about the consumption modes available in Event Grid namespaces, see Pull delivery overview or Push delivery overview.
The following screenshot shows the settings for a pull delivery subscription:
The following screenshot shows the settings for a push delivery subscription:
On the Filters tab, add the event types that you want to filter on, and add any context attribute filters that you want to use in the subscription.
On the Additional features tab, set the lock duration in minutes, specify the maximum delivery count, and then select Create.
View an event subscription in a namespace topic
Go to the namespace topic that contains the event subscription that you want to view. For steps to locate a topic, see Create, view, and manage namespace topics.
In the Entities section, select Subscriptions.
Search for the subscription that you want to view, and then select it.
Review the event subscription settings.
Delete an event subscription in a namespace topic
Go to the namespace topic that contains the event subscription that you want to delete. For steps to locate a topic, see Create, view, and manage namespace topics.
In the Entities section, select Subscriptions.
Search for the subscription that you want to delete, and then select it.
On the Overview page, select Delete on the toolbar.
On the confirmation page, enter the name of the resource, and then select Delete to confirm the deletion.
Configure filters for a namespace topic subscription
To update the filters for an existing subscription, go to the subscription, and then select Filters in the Settings section. Add the event types that you want to filter on, add any context attribute filters that you want to use, and then select Save.
Simplified filtering model for namespace topic subscriptions
Event subscriptions under a namespace topic have a simplified filtering configuration model compared to event subscriptions to domains and to custom, system, partner, and domain topics. The filtering capabilities are the same, except for how you configure filters on the subject attribute. The following sections explain the differences.
Filter on event data
You can filter events based on values in the event data object when the event data is a JSON object. For more information, see Event subscriptions.
Subject begins with
No dedicated configuration properties specify filters on subject. To filter the context attribute subject with a value that begins with a string, use the following filter configuration.
| key value | operator | value |
|---|---|---|
| subject | String begins with | your string |
Subject ends with
No dedicated configuration properties specify filters on subject. To filter the context attribute subject with a value that ends with a string, use the following filter configuration.
| key value | operator | value |
|---|---|---|
| subject | String ends with | your string |