skip to Main Content

We have web activity and it always return below string with value change (value is dynamic everyday). We would need to extract key value. Please advise how to achieve this in Azure Data Factory activities.

Set Activity return value : Value= "{"aws_access_key_id":"XE6MX","aws_secret_access_key":"sgD6zEe"}"

We would like to get aws_access_key_id value XE6MX in separate variable so we can pass it to subsequent activities. And this value id dynamic and changes every day

tried with replace and search functions but couldn’t work out.

2

Answers


  1. If you just want to get the data from web activity output, try to set the value- of the variable in the Set variable activity assign the output like this

     @activity('GetWebActivity').output.aws_access_key_id  
    
    Login or Signup to reply.
  2. { 
    "name": "var1",
    "value": "{"aws_access_key_id":"XE6MX","aws_secret_access_key":"sgD6zEe"}"
    }
    

    If you have set variable activity output like above, you can convert the JSON string from the variable to JSON and then access the required property as suggested in comments.

    @json(variables('var1')).aws_access_key_id
    

    enter image description here

    Output:

    enter image description here

    Check if your web activity returns the same JSON string, and if its same, you can get the output from web activity output itself.

    @json(<web activity output expression for the JSON string>).aws_access_key_id
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search