0
votes

For some reason, today my Python Azure Function is not firing.

Setup:

  • Trigger: Blob upload to storage account
  • Method: EventGrid
  • Auth: Uses System-assigned Managed Identity to auth to Storage Account
  • Advanced Filters:
    • Subject ends with .csv, .json
    • data.api contains "FlushWithClose"

Issue:

  • Upload a .csv file
  • No EventGrid triggered
  • New "ClientOtherError" and "AuthorizationError"s shown in logs enter image description here

Question:

These are NEW errors and this is NEW behavior of an otherwise working Function. No changes have been recently made.

  • What do these errors mean?
  • How do I troubleshoot them?
1
Thats my post too. It focuses on What are these new errors? How do I create an App Insight alert that catches them? This post focuses on What do these errors mean? How do I troubleshoot them? - ericOnline

1 Answers

0
votes

The way I troubleshot the Function was to:

  1. Remove ALL ADVANCED FILTERS from the EventGrid trigger
  2. Attempt upload
  3. Upload successful
  4. Look at EventGrid message
  5. The culprit (though unclear why ClientOtherError and AuthorizationError are generated here!) seems to be:
  • Files pushed to Azure Storage via Azure Data Factory use the FlushWithClose api.
  • These are the only ones I want to grab
  • Our automations all use ADF and if you don't have the FlushWithClose filter in place, your Functions will run 2x (because ADF causes two events on the storage but only one (flush with close) is the actual blob write.)
{
    "id": "redact",
    "data": {
        "api": "FlushWithClose",
        "requestId": "redact",
        "eTag": "redact",
        "contentType": "application/octet-stream",
        "contentLength": 87731520,
        "contentOffset": 0,
        "blobType": "BlockBlob",
        "blobUrl": "https://mything.blob.core.windows.net/mything/20201209/yep.csv",
        "url": "https://mything.dfs.core.windows.net/mything/20201209/yep.csv",
        "sequencer": "0000000000000000000000000000701b0000000000008177",
        "identity": "redact",
        "storageDiagnostics": {
            "batchId": "redact"
        }
    },
    "topic": "/subscriptions/redact/resourceGroups/redact/providers/Microsoft.Storage/storageAccounts/redact",
    "subject": "/blobServices/default/containers/mything/blobs/20201209/yep.csv",
    "event_type": "Microsoft.Storage.BlobCreated"
}
  • Files pushed to Azure Storage via Azure Storage Explorer (and via Azure Portal) use the PutBlob api.
{
    "id": "redact",
    "data": {
        "api": "PutBlob",
        "clientRequestId": "redact",
        "requestId": "redact",
        "eTag": "redact",
        "contentType": "application/vnd.ms-excel",
        "contentLength": 1889042,
        "blobType": "BlockBlob",
        "blobUrl": "https://mything.blob.core.windows.net/thing/yep.csv",
        "url": "https://mything.blob.core.windows.net/thing/yep.csv",
        "sequencer": "0000000000000000000000000000761d0000000000000b6e",
        "storageDiagnostics": {
            "batchId": "redact"
        }
    },
    "topic": "/subscriptions/redact/resourceGroups/redact/providers/Microsoft.Storage/storageAccounts/redact",
    "subject": "/blobServices/default/containers/thing/blobs/yep.csv",
    "event_type": "Microsoft.Storage.BlobCreated"
}
  • I was testing locally with ASE instead of using our ADF automations
  • Thus the advanced filter for data.api was not triggering the EventGrid

Ok... but what about the errors?