Events publishing but not matching to the event subscription

Lucresse Pearle 0 Reputation points
2026-10-08T16:14:47.8766667+00:00

Hi,

currently facing an issue an issue with the events not matching to the correct event subcription when a file is being sent to the storage account authenticated by sas token but when we add a file manually the events matches and delivers.

We already checked the subscription filters and verified that nothing was changed around the time when the issue started. We also checked the event type, subject and we do not see any changes there.

So at this point, it does not look like a filter mismatch configuration issue. Events are being successfully published to the Event Grid Namespace topic, but they are not being delivered to subscribers when the they are sent by the sender using a sas token.

Could you please advise what else could cause events to be accepted/published but not delivered or matched by subscription, could it be the sas token?

Azure Event Grid
Azure Event Grid

An Azure event routing service designed for high availability, consistent performance, and dynamic scale.


4 answers

Sort by: Most helpful
  1. Likhitha Sulake 105 Reputation points Microsoft External Staff Moderator
    2026-10-11T16:12:43.35+00:00

    Hi @Lucresse Pearle ,
    Compare one working and one failing event Compare the complete event payload generated by:

    • Manual file upload, which delivers successfully.
    • SAS-based upload, which doesn't match/deliver.

    Pay particular attention to type, subject, and any fields used by advanced subscription filters, since Event Grid namespace subscriptions can filter on event types, subject prefix/suffix, and advanced fields.

    1. Check all subscription filters Even if eventType and subject look the same, verify whether any advanced filtering exists and whether the corresponding event field/value differs between the working and failing events.
    2. Verify the SAS scope Confirm that the SAS token is scoped to the expected Event Grid namespace/topic. Event Grid SAS tokens can be scoped at namespace, namespace-topic, or event-subscription level.

    Confirm whether this is matching or delivery If the event doesn't match the subscription, focus on payload/filter differences. If it matches but isn't reaching the destination, investigate the event handler/delivery path separately. Event subscriptions determine which topic events are sent to the configured endpoint.

    Was this answer helpful?

    0 comments No comments

  2. Fabian Zankl 345 Reputation points
    2026-10-08T19:12:25.19+00:00

    Hi @Lucresse Pearle ,

    you are trying to find out why events from uploads that use a SAS token are published to the Event Grid namespace topic but do not match the subscription, while manual uploads to the same path match and are delivered. Subject, event type, path, suffix, and casing are identical in both payloads.

    Compare the data section of both events

    Subject and event type are covered by your comparison, and path, suffix, and casing are part of the subject. The data object of the event has not been compared yet. If these are Blob Storage events forwarded to the namespace topic, each event also carries a data object whose values depend on the REST operation the uploading client called. The SAS token itself is not a matching criterion, but the client that uses it can call a different operation than the portal does. The Blob Storage event schema documents three fields that can differ while the subject stays identical:

    • data.api names the operation that triggered the event. With the Blob REST API, BlobCreated is raised for PutBlob, PutBlockList, and CopyBlob. On an account with hierarchical namespace enabled, a client that uses the Data Lake Storage Gen2 API produces CreateFile and FlushWithClose instead, and the documented CreateFile example has a contentLength of 0.
    • data.contentType is the content type stored on the blob. Per Put Blob, the default is application/octet-stream when no content type is specified. A client can set the stored value through the Content-Type header or the x-ms-blob-content-type header, so the value depends on what the uploading tool sends.
    • data.contentLength is the blob size in bytes.

    Check for advanced filters on the namespace subscription

    You mention that the filters were checked and have not changed. Unchanged filters can still reject events whose data differs, so the first question is whether the subscription has any advanced filters on keys inside data. If it does, two documented behaviors apply:

    • If the event does not contain the filter key, most operators, StringIn included, evaluate to not matched.
    • String comparisons in advanced filters are not case-sensitive, so casing in data values cannot explain the mismatch.

    A StringIn filter on data.api listing PutBlob and PutBlockList does not match FlushWithClose, although all three operations raise Microsoft.Storage.BlobCreated. The schema documentation recommends filtering on FlushWithClose for Data Lake Storage Gen2, so a filter list written for one client can lack the operation that another client uses. The same applies to a filter on data.contentType or a minimum data.contentLength. If the subscription has no advanced filters, this explanation does not apply.

    Check the matching metrics

    The namespace exposes Unmatched Events, counted for the whole topic, and Matched Events, counted per subscription. If Unmatched Events increases during a test window with only SAS uploads while Matched Events stays flat for the affected subscription, the events reach the topic and no subscription matches them, which rules out a delivery failure at the destination. The metrics do not show whether a filter or a service-side problem causes the mismatch. Advanced filters can also reference CloudEvents attributes such as source or extension attributes, so the comparison has to cover every key the filters use, inside and outside data. If both events satisfy all configured filter criteria and only one of them matches, an Azure Support case is the next step for the service-side matching behavior.

    Could you share the subscription's full filter definition, advanced filters included, together with one complete matching and one complete non-matching event?

    References


    Drafted with help from Claude, disclosed per the Q&A AI usage policy. Documented: event fields, filter behavior, and metrics, checked against the Learn pages listed above. Not reproduced: that the events are forwarded Blob Storage events and that the two upload paths differ in the data section.

    Was this answer helpful?

    0 comments No comments

  3. Lucresse Pearle 0 Reputation points
    2026-10-08T16:58:42.0333333+00:00

    I have compared:

    • subject
    • event type
    • container path / blob path
    • filename suffix
    • casing

    and they are all identical.

    Was this answer helpful?

    0 comments No comments

  4. AI answer

    2026-10-08T16:15:08.92+00:00

    If events are accepted or published but not matching any subscription, the first thing to verify is the event subject value for the SAS-uploaded files versus the manually uploaded files.

    For Blob Storage events, Event Grid subject filtering is based on the subject string, and matching only supports:

    • subjectBeginsWith
    • subjectEndsWith
    • optional case-sensitive matching

    No wildcards are allowed for subject filters. Blob event subjects use this format:

    /blobServices/default/containers/<containername>/blobs/<blobname>
    

    Checks to perform:

    1. Compare the actual subject on a working manual upload event and a non-matching SAS upload event.
      • If the SAS path, container name, folder prefix, or blob suffix differs, the subscription can stop matching even when publishing succeeds.
      • If case-sensitive subject matching is enabled, verify casing is identical.
    2. Recheck the subscription’s subject filters against the exact Blob subject format.
      • To match a specific container, use a prefix like:
             /blobServices/default/containers/containername/
        
      • To match a folder or blob prefix, use:
             /blobServices/default/containers/containername/blobs/blobprefix
        
      • To match file suffixes, use subjectEndsWith such as .jpg or .log.
    3. Verify whether the subscription is filtering by event type as well.
      • Event Grid subscriptions can filter by included event types in addition to subject.
      • If the SAS-based upload results in a different event pattern than the manual upload, the event may publish successfully but still not match the subscription.
    4. If this is an Event Grid Namespace topic scenario and MatchedEventCount dropped to zero while publishing continues, this can also be a platform-side issue rather than a filter issue.
      • A documented Microsoft Q&A case describes events continuing to publish successfully while subscription matching stopped, and the resolution required backend mitigation.

    About the SAS token specifically:

    • The provided material does not indicate that a SAS token itself changes Event Grid subscription matching behavior.
    • Matching is based on the event data, especially the subject and configured filters.
    • If SAS uploads are producing events with a different subject path or event characteristics than manual uploads, that would explain accepted-but-unmatched behavior.

    A practical end-to-end validation path is:

    1. Capture one event from a manual upload that matches.
    2. Capture one event from a SAS upload that does not match.
    3. Compare:
      • subject
      • event type
      • container path / blob path
      • filename suffix
      • casing
    4. In the subscription, verify:
      • subjectBeginsWith
      • subjectEndsWith
      • case-sensitive subject matching
      • included event types
    5. If those values are identical in the event payloads and matching still does not occur, treat it as a service-side matching issue and open a support case.

    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.