Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us at FabCon Vienna from September 15-18, 2025, for the ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM. Get registered

Reply
KBD
Helper II
Helper II

pulling data from a REST API via Linked Service & Copy object

Hello All:

 

I have been tasked with pulling data from a REST API , munging it and making it available for reporting (Power BI).

I have a the calls required working in POSTMAN and via Python from my desktop. 

Now I need to move this processing to Azure.

 

I have gotten a couple of things to work.

KBD_0-1750969011921.png

 

Referring to the above:

Use a Web object to get a session token - required for all subsequent calls  proof I have correct URL , User Id & Password.

Use Set objects to set variables with values from the results.  Session Token is important.

Use Copy object to write out results

Web objects to simple calls to REST API  to prove session token returned is valid.

This works fine.   Progress

 

The REST copy data object is failing.  I want to use Copy data because I read it can handle pagination.

Some of the result data sets require multiple calls.  Larger than the record limit set on the API.

There are parameters on the Copy object for pagination.  But we are not there yet.

 

POSTMAN generates this python code:

import requests
import json

url = "https://software.restapi.us/platformapi/core/system/applicationinfo/version"

payload = {}
headers = {
  'Accept': 'application/json,text/html,application/xhtml+xml,application/xml',
  'Content-Type': 'application/json',
  'Authorization': 'XXXXX session-id=bigreddog5E383AAB611A6510'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)

this works.  The REST API expects those headers.   

 

This is what I created in data factory

 

Linked Service

KBD_1-1750970485776.png

 

 

Linked Service

{
    "name": "SoftwareREST",
    "properties": {
        "annotations": [],
        "type": "RestService",
        "typeProperties": {
            "url": "https://software.restapi.us/platformapi/core/",
            "authenticationType": "Anonymous"
        }
    },
    "Accept": "application/json,text/html,application/xhtml+xml,application/xml",
    "Content-Type": "application/json"
}

 

Data Set

KBD_2-1750970811194.png

 

KBD_3-1750970886295.png

Default value is:

@concat('XXXXX session_id=', variables('XXXXXSessionToken') )

 

{
    "name": "XXXXXRESTDataSetVersion_In",
    "properties": {
        "linkedServiceName": {
            "referenceName": "XXXXXREST",
            "type": "LinkedServiceReference"
        },
        "parameters": {
            "Authorization": {
                "type": "string",
                "defaultValue": "@concat('XXXXX session_id=',    variables('XXXXXSessionToken')  )"
            }
        },
        "annotations": [],
        "type": "RestResource",
        "typeProperties": {
            "relativeUrl": "system/applicationinfo/version"
        },
        "schema": []
    }
}

 

When run I get the following error:

 

Failure happened on 'Source' side. ErrorCode=RestCallFailedWithClientError,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,
Message=Rest call failed with client error, status code 401 Unauthorized, please check your activity settings.
Request URL: https://XXXXX.RESTAPI.us/platformapi/core/system/applicationinfo/version.
Response: ,Source=Microsoft.DataTransfer.ClientLibrary,'

 

Question:

How do I configure this call using the data factory objects?  

What should the Linked Service look like?   and what should the Source Data Set look like?

 

Many thanks for your kind attention to this matter.

 

Best Regards

 

KD

 

0 REPLIES 0

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June FBC25 Carousel

Fabric Monthly Update - June 2025

Check out the June 2025 Fabric update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.