Logic App - Azure Blob Storage connector returns 200 without content provided

Michal Pipal 25 Reputation points
2023-08-24T11:38:49.21+00:00

I have a Storage Account which is observed by an Event Grid. Every time there's a new blob, Event Grid sends a message to the Service Bus topic. Its subscription is triggering a Logic App.

In the Logic App, I am loading the file from the Storage Account using the Azure Blob Storage connector. Most of the time, this works well. I got a 200 status back together with the file content.

User's image

However, sometimes (3 runs from around 600), the connector returns 200 but has no content. The Action is marked as successful, and no error is shown. Just the content is not provided. It is an issue because the following logic fails as it doesn't expect this behavior.

User's image

I was checking the Storage Account, and the file is there. Also, when I resubmit this run, the connector returns the file without problems, and the run completes successfully. By the way, if the issue would be that the file is missing in the Storage Account because someone has deleted it, for example, the connector would return 404, which is something I would expect.
(But this is not the case anyway, as the file exists)

User's image

Do you have any idea where might be the issue?

Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
2,468 questions
Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
2,887 questions
Azure Event Grid
Azure Event Grid
An Azure event routing service designed for high availability, consistent performance, and dynamic scale.
320 questions
{count} votes

1 answer

Sort by: Most helpful
  1. MayankBargali-MSFT 69,331 Reputation points
    2023-08-28T09:17:16.2133333+00:00

    @Michal Pipal Thanks for reaching and apology for the delay.

    Confirming my understanding on your workflow:

    Storage (events) --> Event Grid --> Service bus topic (endpoint) --> Logic App (Service bus triggered)

    It looks like the issue may be observed with the larger/bigger files where the file was not completely uploaded, and your workflow gets triggered.

    I believe you are filtering only with Microsoft.Storage.BlobCreated events at the event grid subscription end. Reviewing this document and in the note section you should also filter the event with FlushWithClose and not with CreateFile event which file when the file is created and not completely uploaded to the blob storage. If the file is not completely uploaded and you tried to access the blob path, then you would observe 404 error as you have observed.

    For Azure Data Lake Storage Gen2, if you want to ensure that the Microsoft.Storage.BlobCreated event is triggered only when a Block Blob is completely committed, filter the event for the FlushWithClose REST API call. This API call triggers the Microsoft.Storage.BlobCreated event only after data is fully committed to a Block Blob. To learn how to create a filter, see Filter events for Event Grid.

    The suggestion would be further filter the event with data.api value as data FlushWithClose at the event grid subscription end to resolve the issue.

    Please "Accept Answer" if the answer is helpful so that it can help others in the community.