Define a parameter in your pipeline to store the base URL of your API.
Then, create a dataset for your REST API. In the dataset URL, use a dynamic expression to include the integer query parameter.
Use the ForEach activity to iterate over your list of integer IDs.
Then, inside the ForEach activity, configure the Copy Data activity to use the dynamic URL with the integer query parameter.
- Define a Parameter for the Base URL: In your pipeline, define a parameter for the base URL, for example,
BaseURL
. - Create a REST API Dataset: Create a REST API dataset with the URL field dynamically set. For instance:
{ "type": "HttpFile", "typeProperties": { "url": { "type": "Expression", "value": "@concat(pipeline().parameters.BaseURL, '?id=', pipeline().parameters.id)" }, "requestMethod": "GET" } }
- Set up the ForEach Activity: Add a ForEach activity to your pipeline. In the settings of the ForEach activity, pass the list of IDs that you want to iterate over. For example, if you have a list of IDs in an array parameter
IDList
, you can set it as the Items property of the ForEach activity. - Add Parameters to the ForEach Activity: Add a parameter to the ForEach activity to pass the current ID to the Copy Data activity. For instance, you can name the parameter
currentID
. - Configure the Copy Data Activity Inside the ForEach: Inside the ForEach activity, add a Copy Data activity. Set the source of the Copy Data activity to use the REST API dataset.
- In the dataset properties, set the
id
parameter to the value of the current ID in the ForEach loop. Use dynamic content to achieve this. - In the Copy Data activity's source dataset, set the
id
parameter to@item()
, which references the current item in the ForEach loop.
- In the dataset properties, set the