foreachazure-data-factory

ADF - How to set item from for each loop into copy data


I have below url set as baseurl in http linked service: https://app.zipcodebase.com/api/v1/country/province?apikey=997db720-a95e-dd921aaa6fad&country= enter image description here

I have created below datasets and set relative url as item() to get value from for eachloop: enter image description here

Also I have create pipeline parameter and set it to items inside the foreach loop: enter image description here

enter image description here but when I debug the pipeline it's getting failed and giving below error:

ErrorCode=HttpRequestFailedWithClientError,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=Http request failed with client error, status code 404 NotFound, please check your activity settings. If you configured a baseUrl that includes path, please make sure it ends with '/'. Request URL: https://app.zipcodebase.com/api/v1/country/item().,Source=Microsoft.DataTransfer.ClientLibrary,''Type=System.Net.WebException,Message=The remote server returned an error: (404) Not Found.,Source=System,'

I think there is an issue with Relative URL, can you please help me resolve issue?


Solution

  • Data sets are not directly connected to the pipeline run, so you have hardcoded "item()" into your path rather than a reference to the runtime data.

    Instead, use a parameter in your data set: enter image description here

    Then set the value of your relative URL to the parameter: enter image description here

    In the pipeline, pass item() as the dataset parameter value: enter image description here