How to copy data from rest api using oauth to azure storage as json using adf

Luuk van Vliet 276 Reputation points
2020-11-10T20:07:55.09+00:00

I have difficulties creating an ADF pipeline that pulls data from a REST API using oAuth and writes it to azure blob storage in JSON format. I am a python developer and relatively new to adf. I will explain in more detail below.

  1. I need to obtain an access token by posting a request to the token endpoint. This step works fine.
  2. I need to pull the data from the API using a GET request in a copy activity. Also I need to include pagination and I am kind of wondering how to put the next link as it contains a "." inside its key.

38922-adf-7.png

I get the following error, hope you can help me out. Because I am trying to put this workflow on ADF instead of a python script that does this job.

38800-adf-8.png

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
10,709 questions
{count} votes

Accepted answer
  1. Luuk van Vliet 276 Reputation points
    2020-11-24T10:46:40.917+00:00

    Hi @MartinJaffer-MSFT ,

    Thanks, and how do I escape the "." after "@odata" in '@odata.nextLink' ?


1 additional answer

Sort by: Most helpful
  1. Luuk van Vliet 276 Reputation points
    2020-11-13T09:49:34.773+00:00

    Hi @MartinJaffer-MSFT ,

    The pagination url looks as follows
    '@odata.nextLink': 'base_url/odata/table?$skip=250'

    So the workflow is as follows:

    1. POST request to token url to obtain bearer token
    2. Session.Headers['Authorization'] = Token from step 1
    3. GET request to endpoint, append data to list, make call to
      @odata.nextLink': 'base_url/odata/table?$skip=250
      , append to list, and so on.

    Would this be possible in data factory? I want to fetch the json from the api and copy it to a blob storage


Your answer

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