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

Integration Testing Azure Functions with Reqnroll and C#, Part 5 - Using Corvus.Testing.ReqnRoll in a build pipeline

If you use Azure Functions on a regular basis, you'll likely have grappled with the challenge of testing them. In the final post in this serie...

1 day ago

Integration Testing Azure Functions with Reqnroll and C#, Part 4 - Controlling your functions with additional configuration

If you use Azure Functions on a regular basis, you'll likely have grappled with the challenge of testing them. In the fourth of this series of...

1 day ago

Integration Testing Azure Functions with Reqnroll and C#, Part 3 - Using hooks to start Functions

If you use Azure Functions on a regular basis, you'll likely have grappled with the challenge of testing them. In the third of a series of pos...

1 day ago

Integration Testing Azure Functions with Reqnroll and C#, Part 2 - Using step bindings to start Functions

If you use Azure Functions on a regular basis, you'll likely have grappled with the challenge of testing them. In the second of a series of po...

1 day ago

Integration Testing Azure Functions with Reqnroll and C#, Part 1 - Introduction

If you use Azure Functions on a regular basis, you'll likely have grappled with the challenge of testing them. In the first of a series of pos...

1 day ago

Announcing Azure MCP Server 2.0 Stable Release for Self-Hosted Agentic Cloud Automation

Azure MCP Server 2.0 is now generally available, delivering first-class self-hosting, stronger security hardening, and a faster foundation for...

2 days ago

Azure Security: Private Vs. Service Endpoints

When connecting securely to a platform service such as a key vault or an Azure storage account, Microsoft recommends using a private endpoint ...

2 days ago

Give your Foundry Agent Custom Tools with MCP Servers on Azure Functions

Learn how to connect your MCP server hosted on Azure Functions to Microsoft Foundry agents. This post covers authentication options and setup ...

4 days ago

Azure Data Factory Tips for Reliable Microsoft Dynamics 365 CE and Dataverse Integrations

Reliable integrations between Microsoft Dynamics 365 Customer Engagement and external systems can become challenging. This is especially true ...

4 days ago

Scalable AI with Azure Cosmos DB: Tredence Intelligent Document Processing (IDP) | March 2026

Azure Cosmos DB enables scalable AI-driven document processing, addressing one of the biggest barriers to operational scale in today’s enterpr...

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