ADF Copy Activity for JSON filesfails to Locate Blob Despite Successful Metadata Retrieval

Denktas, Gökalp Yigit 20 Reputation points
2025-02-17T23:18:32.66+00:00

I’m currently working on an Azure Data Factory (ADF) pipeline that consolidates files from multiple source containers into a single target container. The goal is to gather one file type (lod2) from various resource-based subfolders and versioned folders in source before storing them all under a consolidated lod2 folder in target.

Below is a redacted view of my Azure Storage structure:

Storage Account: 
Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
11,272 questions
{count} votes

Accepted answer
  1. J N S S Kasyap 80 Reputation points Microsoft Vendor
    2025-02-19T07:52:43.5766667+00:00

    @Denktas, Gökalp Yigit

    Wildcard Handling:

    This usually happens when the file path or dataset isn’t set up to handle the wildcard correctly. You need to make sure the file path in the dataset is configured properly to allow ADF to expand the wildcard and match all the .json files.
    To treat *.json as a wildcard filter rather than a literal file name, Azure Data Factory requires that the dataset and Copy Data activity are configured to use dynamic expressions for both the folder path and the file pattern. Here's the approach.
    To pass the file name dynamically in Azure Data Factory:
    1.Modify the Dataset: Add a parameter called fileName to your lod2_json dataset and set the file path to @{dataset().fileName}.
    2.Configure Copy Data Activity: In the Copy Data activity, pass *.json as the value for the fileName parameter.
    3.Set File Path: Ensure the file path in the dataset uses the @{dataset().fileName} setup, which will allow the activity to match all .json files in the specified path.

    Maintaining Current Pipeline Logic:

    You can preserve the current pipeline structure by keeping the dynamic folder path and wildcard selection in place, while ensuring that metadata retrieval correctly identifies the files, and the Copy Data activity can still process all files matching the wildcard without looping over each file individually.
    I hope this information helps. Please do let us know if you have any further queries.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

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.