Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Secure ADF v2 Pipeline Parameter String for WebActivity

I have ADF v2 Pipeline with a WebActivity which has a REST Post Call to get Jwt Access token from AD token api (https://login.microsoftonline.com/myorg.onmicrosoft.com/oauth2/token)

I have to pass username and password in the body. Right now, i'm using pipeline parameters to pass these with the request and is working fine.

username=@{pipeline().parameters.username}
&password=@{pipeline().parameters.password}

But, the parameters tab has plain text which i have to secure.

enter image description here

now, what options do i have to secure the parameter values i'm using in this pipeline instead of plain text.

i have explored this article https://docs.microsoft.com/en-us/azure/data-factory/store-credentials-in-key-vault#reference-secret-stored-in-key-vault But, this is to store secrets for data stores. In my web activity i do not have any dataset. it is just a web activity with rest call.

Any help or pointers would be appreciated. Thanks

like image 843
Naresh Podishetty Avatar asked Aug 02 '18 09:08

Naresh Podishetty


People also ask

How do I add a pipeline parameter to ADF?

To add parameters to your data flow, click on the blank portion of the data flow canvas to see the general properties. In the settings pane, you will see a tab called Parameter. Select New to generate a new parameter. For each parameter, you must assign a name, select a type, and optionally set a default value.

What are pipeline parameters in ADF?

You can use parameters to pass external values into pipelines, datasets, linked services, and data flows. Once the parameter has been passed into the resource, it cannot be changed. By parameterizing resources, you can reuse them with different values each time.

How do you get Keyvault secret in ADF?

Open the key vault access policies and add the managed identity permissions to Get and List secrets. Click Add, then click Save. Navigate to your Key Vault secret and copy the Secret Identifier.


1 Answers

I have implemented little differently,here is my implementation.

  1. Store your credential in storage account of your choice.
  2. use lookup activity in data factory.
  3. use lookup activity output for your rest api call.

I hope this will help. in your case you can use something like this

create a file generateToken.json { "resource":"xxxxxxxxxxxxxxxx", "client_id":"xxxxxxxxxxxxxxx" "grant_type":"xxxxxxxxxxxxxxxx" "username":"xxxxxxxxxxxxxxxxxxx" "password":"xxxxxxxxxxxxxxxxxxxx" }

if you are concern about security of password, decode your password before you add to the generateToken.json and decode at data factory before you make rest api call to generate token using data factory decodeBase64 function.

Viral

like image 191
user4332145 Avatar answered Sep 26 '22 02:09

user4332145