Create linked service of REST when a token is part of the url

110 Views Asked by At

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.

1

There are 1 best solutions below

2
Anupam Chand On BEST ANSWER

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.