parameterize the url in linked service

Josh 46 Reputation points
2024-02-26T08:23:35.3633333+00:00

i'm trying to pass the url has parameter in copy data activity through linked service

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
10,522 questions
{count} votes

1 answer

Sort by: Most helpful
  1. phemanth 10,010 Reputation points Microsoft Vendor
    2024-02-26T08:51:21.26+00:00

    @Josh

    Thanks for reaching out to Microsoft Q&A.

    Here are two ways to parameterize URLs in linked services within Azure Data Factory (ADF): 1. Using Global Parameters: This method is suitable when the URL parameter value needs to be reused across different pipelines or activities. Here's how to do it: a. Create a Global Parameter:

    1. Go to the Manage tab in ADF Studio.
    2. Click on Global parameters.
    3. Click New to create a new parameter.
    4. Enter a descriptive name for your parameter (e.g., baseUrl).
    5. Choose the appropriate data type (e.g., String).
    6. Optionally, provide a default value for the parameter.
    7. Click OK to save the parameter.

    b. Use the Parameter in the Linked Service URL:

    1. Open the Linked Service you want to modify.
    2. Locate the property containing the URL (e.g., http://example.com/data).
    3. In the URL definition, use the ADF expression language to reference the global parameter. For example:
    @concat('https://', parameters('baseUrl'), '/data')
    

    2. Using Pipeline Parameters: This method is useful when the URL parameter value is specific to a particular pipeline run. Here are the steps: a. Create a Pipeline Parameter:

    1. Open the pipeline you want to edit.
    2. Go to the Parameters tab.
    3. Click New to create a new parameter.
    4. Enter a descriptive name for your parameter (e.g., baseUrl).
    5. Choose the appropriate data type (e.g., String).
    6. Optionally, provide a default value for the parameter.
    7. Click OK to save the parameter.

    b. Use the Parameter in the Linked Service URL:

    1. Open the Linked Service you want to modify.
    2. Locate the property containing the URL.
    3. In the URL definition, directly reference the pipeline parameter enclosed in double quotes. For example:
    "https://{{parameters('baseUrl')}}/data"
    

    for detailed information

    refer; https://learn.microsoft.com/en-us/azure/data-factory/parameterize-linked-services?tabs=data-factory

    Hope this helps. Do let us know if you any further queries.


    If this answers your query, do click Accept Answer and Yes for was this answer helpful. And, if you have any further query do let us know.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.