LinkedService parameterization

Maryna Paluyanava 211 Reputation points
2022-09-28T11:43:03.82+00:00

Hello,
Question 1:
Could you please tell me if there is possibility to store access token as a parameter at linked service?
I mean, can we create a linked service parameter LS_ACCESS_TOKEN at Parameters section and reference to the Azure Key Vault to get the value of the access token for the purpose of using it in the pipeline. Now I use Web Activity to get the access token from the Azure Key Vault.

Question 2:
When I test connection it is successful. However when I run the pipeline I get an error. Could you please suggest what can be wrong?

Many Thanks!
245657-capture4.png:

245564-capture1.png245583-capture3.png

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
0 comments No comments
{count} votes

Answer accepted by question author
  1. KranthiPakala-MSFT 46,737 Reputation points Microsoft Employee Moderator
    2022-09-28T22:25:46.57+00:00

    Hello @Maryna Paluyanava ,

    Thanks for the question and using MS Q&A platform.

    For Question 1:
    I don't think you can do that. Could you please elaborate a bit on where you will be using the access token by passing it as a parameter to REST linked service?

    If you are talking about the access token that required to send it in the additional headers of your REST endpoint, then you cannot use the AKV to get that as the access token expires every 1 hr and everytime it expires a new access token has to be generated in order to access your endpoint. Hence you will have to use Web activity to get the latest access token and pass it to the respective activity in which you use the REST connector to make a call to the endpoint. In case if I misunderstood your question, please correct me.

    For Question 2:
    Since you are parameterizing the REST connector there is a possibility that some values might be incorrect, or the access token is not valid or even the Additional header is not valid which could result in 403 forbidden error. Henc would recommend hardcoding the values and test by debugging and once it is successful then try parameterizing. This way you will know where it is failing. Either configuration or the access token problem.

    The access token from Web activity has to be pass like here: Additional header: @{concat('Authorization: Bearer ', activity('<Web-activity-name>').output.access_token)}

    Also make sure to provide valid Base URL in Connector config and Relative URL in dataset config.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.