locked
Need to pass parameter to HTTP linked server connection for Source URL from pipeline RRS feed

  • Question

  • Hello, 

    I have a pipeline that needs t pull data from a web site (URL GET request) to download a .zip file every month. I need a way to pass the filename (fileYYYYMM.zip) to get data for every month. Any Ideas?  


    MC

    Wednesday, July 31, 2019 7:21 PM

Answers

  • Hi there,

    Just wanted to check - was the above suggestion useful to you ? If yes, do consider upvoting and/or marking as answer the above reply. This would help other community members reading this thread.

    • Marked as answer by mcr1322 Monday, August 5, 2019 1:28 PM
    Monday, August 5, 2019 10:00 AM

All replies

  • Hi there,

    You can pass the file name as a Relative Url in the HTTP dataset as shown in the below screenshot :

    There's another approach to do so. You can parameterize the Linked Service itself. For HTTP connector, parameterization is not supported on the UI. As a workaround for now, you can do the following :

    • You can create a linked service with a dummy API base url.
    • Once the Linked Service is created, you can edit it's JSON code.
    • Add an attribute "parameters" in the following format :
    {  
       "name":"HttpServer1",
       "type":"Microsoft.DataFactory/factories/linkedservices",
       "properties":{  
          "annotations":[  
    
          ],
          "type":"HttpServer",
          "typeProperties":{  
             "url":"https://reqres.in/api/users/@{linkedService().fileName}",
             "enableServerCertificateValidation":false,
             "authenticationType":"Anonymous"
          },
          "parameters":{  
             "fileName":{  
                "type":"String"
             }
          }
       }
    }

    • Create a dataset using this Linked Service.
    • While creating the dataset, expand "Linked service properties" and specify an expression for the parameter defined, as shown in the below screenshot :

    Hope this helps.

    Thursday, August 1, 2019 7:02 AM
  • Hi there,

    Just wanted to check - was the above suggestion useful to you ? If yes, do consider upvoting and/or marking as answer the above reply. This would help other community members reading this thread.

    • Marked as answer by mcr1322 Monday, August 5, 2019 1:28 PM
    Monday, August 5, 2019 10:00 AM