[ADF]: Using Global Parameters for HostName in SFTP Linked Services

Mehul Gardi 0 Reputation points
2024-07-17T01:28:52.75+00:00

We have been hardcoding the Host value within our SFTP Linked Service and want to allow it to be configurable for deployment to different environments. We attempted to create a Global parameter and set the Host as @{pipeline().globalParameters.SFTPLocation} but are receiving an error that property 'globalParameters' doesn't exist. We referred to a response on Microsoft Q&A that mentioned this approach as supported. Reference: https://learn.microsoft.com/en-us/answers/questions/1378891/adf-global-parameters-inside-linked-service?comment=question#newest-question-comment

Does Hostname support Dynamic expression? What are the possible options to read both Host and UserName from Global Parameters?

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

2 answers

Sort by: Most helpful
  1. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  2. phemanth 13,625 Reputation points Microsoft Vendor
    2024-07-17T06:28:37.04+00:00

    hi @Mehul Gardi

    Thanks for reaching out to Microsoft Q&A.

    Yes, Azure Data Factory does support dynamic expressions and you can use global parameters to pass external values into pipelines, datasets, linked services, and data flows. However, you cannot directly use global parameters in linked services or datasets. They need to be passed from the pipeline.

    Here’s how you can do it:

    Create a Global Parameter: You can create a global parameter in the ‘Manage’ section of Azure Data FactoryScreenshot that highlights the New button you select to create global parameters.

    Use the Global Parameter in a Pipeline: You can use the global parameter in any pipeline expression. If a pipeline is referencing another resource such as a dataset or data flow, you can pass down the global parameter value via that resource’s parameters. The global parameters are referenced as @pipeline().globalParameters.<parameterName>.

    Pass the Global Parameter to Dataset and Linked Service: To use global parameters to create a linked service, you need to do it via Global parameter -> Pipeline -> Dataset -> Linked service You create a global parameter (which can be used in linked service), use it in pipeline to pass its value to dataset via dataset parameter, pass dataset parameter value to linked service parameter which can be referenced using dynamic content in Linked serviceenter image description here
    enter image description here

    refer:https://stackoverflow.com/questions/73054609/azure-datafactory-pass-global-parameter-to-pipeline-or-datasethttps://learn.microsoft.com/en-us/azure/data-factory/author-global-parameters

    Hope this helps. if your issue doesn't resolve or if my understanding is not correct, please provide more information such as configuration details and some screenshots if possible.


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.