0

my API call is of the following format url: base url/page=x&token=yyyy

How can I create a safe linked service for this in Azure Data Factory?

I tried with head auth but don't know how to proceed.

Alex
  • 149
  • 1
  • 1
  • 11

1 Answers1

1

I will explain how to do it for 1 parameter(token), you can extend it for other parameters. First create a variable to store your token. Let's call it "token_variable". You will need to pre-populate this before execution of the rest of the pipeline. enter image description here

Now when you are creating the linked service, you can create a new linked service parameter to hold your token as shown below. Create your url as a concatenation of the base url and the parameter. enter image description here

Now go to the dataset which you have created. You should see the token parameter available. Click on the Value field. enter image description here

Create a new dataset parameter, lets call it "mytokenparm" enter image description here

Now if you go back to you copy activity, you should see this parameter. You can now set it to your token_variable. enter image description here So now, if you set this token_variable to anything, it will dynamically change what is passed down to the dataset and linked service.

Since your token should be secret, it is important to set the secure inputs and outputs checkbox to true for all the activities. This is so the token cannot be seen in the history of the pipeline runs.

Anupam Chand
  • 2,209
  • 1
  • 5
  • 14
  • What if I want to create token parameter in linked service, populate it with default value and then pass it in a concat to my relative path in the dataset? It is then doesn't recognize linkedService() as valid reference... – Alex Aug 21 '23 at 07:41
  • You cannot refer to the linked service variable when setting up the dataset. You will need to use a dataset variable only in that case and build your relative path accordingly. – Anupam Chand Aug 21 '23 at 14:29