Loading...

Azure Data Factory trigger is not initiated when uploading a file using Java SDK

Azure Data Factory trigger is not initiated when uploading a file using Java SDK

Symptoms

 

  •   Uploading files using Java SDK class DataLakeFileClient fails to initiate the ADF trigger. 
  •   Uploading files using Azure Portal initiates the trigger as expected. 
  •   ADF trigger is configured to ignore empty blobs. 

 

Analysis

 

  • Whenever a file is created using ADLS Gen2 REST API, there are 3 operations called at the backend i.e. CreateFile, AppendFile and FlushFile.
  • Microsoft.Storage.BlobCreated event is triggered when a blob is created or replaced. Specifically, this event is triggered when clients use the CreateFile and FlushWithClose operations that are available in the Azure Data Lake Storage Gen2 REST API.
  • As CreateFile API created a 0 byte blob, the event will not be triggered. 

 

Resolution

 

  • You can initiate the trigger by adding FlushWithResponse method with close parameter as true.

Example

 

        boolean close = true;

File file = new File("C:\\Users\\mahmoudsamy\\route.txt");

        fileClient.uploadFromFile("C:\\Users\\mahmoudsamy\\route.txt");

        fileClient.flushWithResponse(file.length(), retainUncomittedData, close, httpHeaders, requestConditions, timeout, contect);

 

Note: Please make sure to pass the correct parameters when using FlushWithResponse to avoid unexpected results.

Published on:

Learn more
Azure PaaS Blog articles
Azure PaaS Blog articles

Azure PaaS Blog articles

Share post:

Related posts

Build 2025 Preview: Transform Your AI Apps and Agents with Azure Cosmos DB

Microsoft Build is less than a week away, and the Azure Cosmos DB team will be out in force to showcase the newest features and capabilities f...

12 hours ago

Fabric Mirroring for Azure Cosmos DB: Public Preview Refresh Now Live with New Features

We’re thrilled to announce the latest refresh of Fabric Mirroring for Azure Cosmos DB, now available with several powerful new features that e...

5 days ago

Power Platform – Use Azure Key Vault secrets with environment variables

We are announcing the ability to use Azure Key Vault secrets with environment variables in Power Platform. This feature will reach general ava...

5 days ago

Validating Azure Key Vault Access Securely in Fabric Notebooks

Working with sensitive data in Microsoft Fabric requires careful handling of secrets, especially when collaborating externally. In a recent cu...

5 days ago

Azure Developer CLI (azd) – May 2025

This post announces the May release of the Azure Developer CLI (`azd`). The post Azure Developer CLI (azd) – May 2025 appeared first on ...

6 days ago
Stay up to date with latest Microsoft Dynamics 365 and Power Platform news!
* Yes, I agree to the privacy policy