Storage Event Trigger will not start Azure Synapse pipeline

FerreiraN 0 Reputation points
2023-08-09T15:49:34.1466667+00:00

I have an Azure Synapse pipeline, with a storage event trigger. The storage event trigger works fine and triggers the pipeline when I manually upload a file using the storage explorer. But when I use a blob client (with Typescript) to write the file (using .upload() method) to the same Blob Storage instead of manual upload, the event doesn't trigger my pipeline.

Azure Synapse Analytics
Azure Synapse Analytics
An Azure analytics service that brings together data integration, enterprise data warehousing, and big data analytics. Previously known as Azure SQL Data Warehouse.
5,373 questions
{count} votes

1 answer

Sort by: Most helpful
  1. PRADEEPCHEEKATLA 90,641 Reputation points Moderator
    2023-08-10T05:24:19.98+00:00

    @FerreiraN - Thanks for the question and using MS Q&A platform.

    It seems like you are trying to trigger an Azure Synapse pipeline using a storage event trigger, but the trigger is not working when you upload a file using a blob client.

    When you upload a file using a blob client, the storage event trigger may not be triggered automatically. This is because the event grid system that triggers the event is not notified when a file is uploaded using a blob client.

    To trigger the storage event trigger when you upload a file using a blob client, you can use the Azure Blob Storage SDK to send a message to the event grid system. You can use the BlobClient.beginCopyFromURL() method to copy the file to the same Blob Storage and trigger the event. Here is an example code snippet:

    const { BlobServiceClient } = require("@azure/storage-blob");
    
    const blobServiceClient = BlobServiceClient.fromConnectionString(connectionString);
    const containerClient = blobServiceClient.getContainerClient(containerName);
    const blobClient = containerClient.getBlobClient(blobName);
    
    const copyResponse = await blobClient.beginCopyFromURL(sourceURL);
    

    In this code snippet, connectionString is the connection string for your Blob Storage account, containerName is the name of the container where you want to upload the file, blobName is the name of the file you want to upload, and sourceURL is the URL of the file you want to copy.

    This code will copy the file to the same Blob Storage and trigger the storage event trigger.

    For more details, refer to Azure Data Factory trigger is not initiated when uploading a file using Java SDK.

    Hope this helps. Do let us know if you any further queries.


    If this answers your query, do click Accept Answer and Yes for was this answer helpful. And, if you have any further query do let us know.


Your answer

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