Search code examples
azure-data-factory

Use Lookup and For Each Iteration to pull data from different analytics.dev.azure.com projects


Hi would just like to ask if this is possible, I am currently working on ADF, what I want to do is get workitems from analytics.dev.azure.com/[Organization]/[Project] then copy it to SQL Database. i am currently already doing this for 1 project, but want to do it for multiple projects without creating multiple copyto tasks within ADF but just run a Lookup to ForEach to iterate through all the team analytics URLs, is there anyway to do this?


Solution

  • We can use lookup and for-each activity to copy data to SQL dB tables from all URLs. Below are the steps

    1. Create a lookup table which contains the entire list of URLs and use this table as a source dataset in lookup activity.

    enter image description here

    1. Next in for each activity's settings, type the following in items for getting output of lookup activity

    @activity('Lookup1').output.value

    enter image description here

    1. Inside for each activity, use copy activity.

    enter image description here

    1. In source, create a dataset and http linked service. Enter the base URL and relative URL. I have stored relative URLs in lookup activity. Thus I have given @{item().url} in relative URL

    enter image description here

    1. In sink, Create azure SQL database table for each item in for each activity or use the existing tables and copy data to those tables.