Skip to content

Commit 5934010

Browse files
Merge pull request #226951 from spelluru/egridgitissues0209
added examples for subject filtering
2 parents 654de83 + 12fe981 commit 5934010

File tree

2 files changed

+34
-7
lines changed

2 files changed

+34
-7
lines changed

articles/event-grid/event-filtering.md

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -96,17 +96,43 @@ The JSON syntax for filtering by event type is:
9696

9797
For simple filtering by subject, specify a starting or ending value for the subject. For example, you can specify the subject ends with `.txt` to only get events related to uploading a text file to storage account. Or, you can filter the subject begins with `/blobServices/default/containers/testcontainer` to get all events for that container but not other containers in the storage account.
9898

99-
When publishing events to custom topics, create subjects for your events that make it easy for subscribers to know whether they're interested in the event. Subscribers use the subject property to filter and route events. Consider adding the path for where the event happened, so subscribers can filter by segments of that path. The path enables subscribers to narrowly or broadly filter events. If you provide a three segment path like `/A/B/C` in the subject, subscribers can filter by the first segment `/A` to get a broad set of events. Those subscribers get events with subjects like `/A/B/C` or `/A/D/E`. Other subscribers can filter by `/A/B` to get a narrower set of events.
99+
When publishing events to custom topics, create subjects for your events that make it easy for subscribers to know whether they're interested in the event. Subscribers use the **subject** property to filter and route events. Consider adding the path for where the event happened, so subscribers can filter by segments of that path. The path enables subscribers to narrowly or broadly filter events. If you provide a three segment path like `/A/B/C` in the subject, subscribers can filter by the first segment `/A` to get a broad set of events. Those subscribers get events with subjects like `/A/B/C` or `/A/D/E`. Other subscribers can filter by `/A/B` to get a narrower set of events.
100100

101-
The JSON syntax for filtering by subject is:
101+
### Examples (Blob Storage events)
102+
Blob events can be filtered by the event type, container name, or name of the object that was created or deleted.
102103

103-
```json
104-
"filter": {
105-
"subjectBeginsWith": "/blobServices/default/containers/mycontainer/blobs/log",
106-
"subjectEndsWith": ".jpg"
107-
}
104+
The subject of Blob storage events uses the format:
108105

109106
```
107+
/blobServices/default/containers/<containername>/blobs/<blobname>
108+
```
109+
110+
To match all events for a storage account, you can leave the subject filters empty.
111+
112+
To match events from blobs created in a set of containers sharing a prefix, use a `subjectBeginsWith` filter like:
113+
114+
```
115+
/blobServices/default/containers/containerprefix
116+
```
117+
118+
To match events from blobs created in specific container, use a `subjectBeginsWith` filter like:
119+
120+
```
121+
/blobServices/default/containers/containername/
122+
```
123+
124+
To match events from blobs created in specific container sharing a blob name prefix, use a `subjectBeginsWith` filter like:
125+
126+
```
127+
/blobServices/default/containers/containername/blobs/blobprefix
128+
```
129+
To match events from blobs create in a specific subfolder of a container, use a `subjectBeginsWith` filter like:
130+
131+
```
132+
/blobServices/default/containers/{containername}/blobs/{subfolder}/
133+
```
134+
135+
To match events from blobs created in specific container sharing a blob suffix, use a `subjectEndsWith` filter like ".log" or ".jpg".
110136

111137
## Advanced filtering
112138

articles/service-bus-messaging/service-bus-resource-manager-exceptions.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ Here are the various exceptions/errors that are surfaced through the Azure Resou
2929
| Bad Request | 40000 | Sub code=40000. Both DelayedPersistence and RequiresDuplicateDetection property can't be enabled together. | Entities with Duplicate detection enabled on them must be persistent, so persistence can't be delayed. | Learn more about [Duplicate Detection](duplicate-detection.md) |
3030
| Bad Request | 40000 | Sub code=40000. The value for RequiresSession property of an existing Queue can't be changed. | Support for sessions should be enabled at the time of entity creation. Once created, you can't enable/disable sessions on an existing entity (queue or subscription) | Delete and recreate a new queue (or subscription) with the "RequiresSession" property enabled. |
3131
| Bad Request | 40000 | Sub code=40000. 'URI_PATH' contains character(s) that isn't allowed by Service Bus. Entity segments can contain only letters, numbers, periods(.), hyphens(-), and underscores(_). | Entity segments can contain only letters, numbers, periods(.), hyphens(-), and underscores(_). Any other characters cause the request to fail. | Ensure that there are no invalid characters in the URI Path. |
32+
| Bad Request | 40000 | Sub code=40000. Bad request. To know more visit `https://aka.ms/sbResourceMgrExceptions`. TrackingId:00000000-0000-0000-0000-00000000000000_000, SystemTracker:contososbusnamesapce.servicebus.windows.net:myqueue, Timestamp:yyyy-mm-ddThh:mm:ss | This error occurs when you try to create a queue in a non-premium tier namespace with a value set to the property `maxMessageSizeInKilobytes`. This property can only be set for queues in the premium namespace. |
3233
| Bad Request | 40300 | Sub code=40300. The maximum number of resources of type `EnablePartioning == true` has been reached or exceeded. | There's a limit on number of partitioned entities per namespace. See [Quotas and limits](service-bus-quotas.md). | |
3334
| Bad Request | 40400 | Sub code=40400. The auto forwarding destination entity doesn't exist. | The destination for the autoforwarding destination entity doesn't exist. | The destination entity (queue or topic), must exist before the source is created. Retry after creating the destination entity. |
3435

0 commit comments

Comments
 (0)