locked
Source In Pipeline Accessing Pipeline Variables RRS feed

  • Question

  • Hello

    I have a Azure Blob Storage Source in a Copy Activity in an ADFv2 Pipeline. I need to make the file in that Source a Variable, or a pipeline parameter like @pipeline().parameters.sourceFile, however when I try to make the filename a Variable such as @variables("FileName") OR use the Pipeline parameter I just mentioned, I get a warning "Variables can only be used within their defining Pipeline.

    So, is there any way around what I am trying to do? I simply just want the filename of the Blob file which triggers the pipeline that I have described above. Is this not possible, and if so, what alternative would you recommend.  I'm attaching a pic and all I want to do is make the FileName a variable for processing one particular file only. When I use *.json it uses all of the blobs in my folder.

    Thank you so much!
    Mike


    Mike Kiser


    • Edited by EMKISER Thursday, August 8, 2019 2:40 AM
    Thursday, August 8, 2019 2:28 AM

Answers

  • Hi Mike,

    I was about to start writing a comprehensive answer on how to do it when I encountered a beautifully written blog on it. Please follow this blog for a detailed explanation on the same.

    In short, Here are the summary steps to correct the problem:

    • In the dataset, create parameter(s).
    • In the dataset, change the dynamic content to reference the new dataset parameters.
    • In the calling pipeline, you will now see your new dataset parameters.  Enter dynamic content referencing the original pipeline parameter.

    Hope this helps.

    Disclaimer : The blog linked above is not an official blog posted by Microsoft.

    Thursday, August 8, 2019 11:25 AM

All replies

  • Hi Mike,

    I was about to start writing a comprehensive answer on how to do it when I encountered a beautifully written blog on it. Please follow this blog for a detailed explanation on the same.

    In short, Here are the summary steps to correct the problem:

    • In the dataset, create parameter(s).
    • In the dataset, change the dynamic content to reference the new dataset parameters.
    • In the calling pipeline, you will now see your new dataset parameters.  Enter dynamic content referencing the original pipeline parameter.

    Hope this helps.

    Disclaimer : The blog linked above is not an official blog posted by Microsoft.

    Thursday, August 8, 2019 11:25 AM
  • Hi Chirag!

    That is EXACTLY what I needed to accomplish! I implemented it yesterday and everything is working great; just in time for my Presentation/Demo on Monday.

    Thanks again!
    Mike


    Mike Kiser

    Friday, August 9, 2019 2:45 PM