question

ewinkiser avatar image
0 Votes"
ewinkiser asked ewinkiser edited

REST Source in ADF Copy Activity Not taking pipeline variables

HI ! @nasreen-akter @KranthiPakala-MSFT @MartinJaffer-MSFT

I have a REST source as shown in the screenshots below in a Copy Activity. I am trying to use a pipeline (the Activities are in the same ForEach Activity. I am trying to use a variable in the Relative URL which is in the pipeline and ForEach. However I am getting an error
Variables can only be used within their defining pipeline

but this variable is in the pipeline....any suggestions? I am stumped at this one......maybe I don't understand the BaseURL and Relative URL? also if I use a item.employeeid (which works in a variable) in this ForEach loop, I get an error that item.employeeid does not exist such as follows. Can anyone please help?
Thanks
Mike Kiser
96706-image.png






96747-image.png


96728-screenshot-2021-05-14-113713.jpg96794-screenshot-2021-05-14-113642.jpg96729-screenshot-2021-05-14-113548.jpg





azure-data-factory
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

nasreen-akter avatar image
1 Vote"
nasreen-akter answered

Hi @ewinkiser,

You can't use variable in the Dataset, instead you can create a parameters in your RestResource1 Dataset and set that parameter in the RelationURL. From the pipeline --> CopyActivity --> source, pass the CeridianDirDepositURL variable value to the Dataset-Parameter. Hope this will work. Thanks!

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

ewinkiser avatar image
0 Votes"
ewinkiser answered ewinkiser edited

Thanks again @MartinJaffer-MSFT and @nasreen-akter !!

Both of you saved me this weekend! It worked!!! I was only allowed to chose ONE answer correct...

I greatly appreciate your detailed answer!
Mike Kiser

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

MartinJaffer-MSFT avatar image
0 Votes"
MartinJaffer-MSFT answered

Hello again @ewinkiser .

I think the confusion is coming from where the variable is being inserted.

The Relative URL you showed in RestResource1 is part of a dataset.

The same Linked Services and Datasets can be used in many pipelines.
Pipelines can have different variables. Variables are properties of pipelines.
A variable cannot be referenced directly via a Linked Service or Dataset.

Parameterize the Linked Service / Dataset. This means using @dataset().parameterName where the variable would be used.
In the pipeline activity, such as copy activity, it will ask you what value to use for the dataset parameter. This is where you reference the variable.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.