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

Scalable AI with Azure Cosmos DB – Video Series

Scalable AI in Action with Azure Cosmos DB – A Monthly Partner Showcase As AI continues to reshape industries, customers are seeking scalable,...

2 hours ago

Translating Documents with Azure AI Translator's sync API

Discover how to leverage Azure AI Translator's Sync API for real-time document translation, simplifying your workflow and enhancing user exper...

9 hours ago

Azure SDK Release (July 2025)

Azure SDK releases every month. In this post, you'll find this month's highlights and release notes. The post Azure SDK Release (July 2025) ap...

5 days ago

Announcing General Availability of UNISTR function and ANSI SQL || Operator in Azure SQL

We’re excited to announce the General Availability (GA) of two long-standing capabilities that address critical needs for SQL developers and e...

6 days ago

Power BI Cognitive Services and Azure Machine Learning features retiring; transition to Fabric AI services

Power BI is retiring Cognitive Services and Azure Machine Learning features by September 15, 2025, transitioning AI capabilities to Microsoft ...

6 days ago

Dynamics 365 Contact Center – Use Azure Communication Service-based SMS Mobile Numbers

How does this affect me? With this feature, Dynamics 365 Contact Center admins can now engage with customers in Australia, Belgium, Denmark, F...

6 days ago

Microsoft Entra: Action Required – Update Conditional Access Policies for Azure DevOps Sign-ins

Microsoft Entra requires updating Conditional Access policies by September 4, 2025, to explicitly include Azure DevOps (App ID: 499b84ac-1321-...

6 days ago

Azure Developer CLI (azd) – July 2025

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

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