Failed to convert the value in 'container' property to 'System.String' type. Please make sure the payload structure and value are correct.

Karthik S Gothe 5 Reputation points
2024-05-09T09:14:54.8866667+00:00

We are creating a Pipeline consisting of some Lookup Activity, Set Variables and Copy Activity using REST APIs provided by Azure Data Factory. Pipeline has some parameters and Variables defined at Pipeline level and at Data set levels. Pipeline and its dependent Datasets are getting created as expected in Data Factory through the REST API Create Pipeline PUT call. But when the pipeline executes after a associated trigger runs we are getting the below mentioned error in Copy Activity. Rest All activities are executing as expected.

Copy Activity Error - Failed to convert the value in 'container' property to 'System.String' type. Please make sure the payload structure and value are correct.

The same error is not encountered when the pipeline created through REST API is published again from the Azure Data factory manually without doing any changes to the pipeline. Subsequent Pipeline Runs after the pipeline is manually published from Data Factory are successful without errors in Copy Activity.

User's image

User's image

These are the Parameters defined to dynamically accept the Values for Container, Folder Path and File Name.

User's image

Datasets are also configured to accept the values dynamically using parameters.

User's image

This is the value for container that we are trying to pass which is defined as string type variable.

User's image

Note - "Failed to convert the value in 'container' property to 'System.String' type. Please make sure the payload structure and value are correct." Getting this error when a pipeline is created using Azure Data factory REST API and until the same pipeline is published again manually from Data Factory without any change

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
9,798 questions
0 comments No comments
{count} vote

1 answer

Sort by: Most helpful
  1. AnnuKumari-MSFT 31,731 Reputation points Microsoft Employee
    2024-05-09T17:43:02.7133333+00:00

    Hi Karthik S Gothe ,

    Thankyou for using Microsoft Q&A platform and thanks for posting your query here.

    As per my understanding , you are encountering an error while executing a pipeline in Azure Data Factory , The Copy Activity is failing with the error message "Failed to convert the value in 'container' property to 'System.String' type .

    I suspect that the variable expressions in source dataset are not getting converted properly. Kindly make sure to use 'add dynamic content' option to pass the expression instead of directly writing the expression.
    User's image

    Additionally, Could you please try explicitly converting the values of variables used in source dataset of copy activity into string by using string interpolation or string function.

    Simply use @{} curly braces around the variables , making the expressions:

    @{variable('containerName')} , @{variables('sourceFolderPath')}, and @{variables('fileName')}

    For more details, kindly check : https://learn.microsoft.com/en-us/azure/data-factory/control-flow-expression-language-functions#expressions

    Hope it helps. Kindly share the json of the pipeline if the above suggestion doesn't help resolve your issue. Please accept the answer in case it was helpful. Thankyou