<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic pulling data from a REST API via Linked Service &amp;amp; Copy object in Pipelines</title>
    <link>https://community.fabric.microsoft.com/t5/Pipelines/pulling-data-from-a-REST-API-via-Linked-Service-amp-Copy-object/m-p/4745723#M8110</link>
    <description>&lt;P&gt;Hello All:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have been tasked with pulling data from a REST API , munging it and making it available for reporting (Power BI).&lt;/P&gt;&lt;P&gt;I have a the calls required working in POSTMAN and via Python from my desktop.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now I need to move this processing to Azure.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have gotten a couple of things to work.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Referring to the above:&lt;/P&gt;&lt;P&gt;Use a Web object to get a session token - required for all subsequent calls&amp;nbsp; proof I have correct URL , User Id &amp;amp; Password.&lt;/P&gt;&lt;P&gt;Use Set objects to set variables with values from the results.&amp;nbsp; Session Token is important.&lt;/P&gt;&lt;P&gt;Use Copy object to write out results&lt;/P&gt;&lt;P&gt;Web objects to simple calls to REST API&amp;nbsp; to prove session token returned is valid.&lt;/P&gt;&lt;P&gt;This works fine.&amp;nbsp; &amp;nbsp;Progress&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The REST copy data object is failing.&amp;nbsp; I want to use Copy data because I read it can handle pagination.&lt;/P&gt;&lt;P&gt;Some of the result data sets require multiple calls.&amp;nbsp; Larger than the record limit set on the API.&lt;/P&gt;&lt;P&gt;There are parameters on the Copy object for pagination.&amp;nbsp; But we are not there yet.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;POSTMAN generates this python code:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;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)&lt;/LI-CODE&gt;&lt;P&gt;this works.&amp;nbsp; The REST API expects those headers.&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is what I created in data factory&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;Linked Service&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Linked Service&lt;/P&gt;&lt;LI-CODE lang="python"&gt;{
    "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"
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data Set&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Default value is:&lt;/P&gt;&lt;P&gt;@concat('XXXXX session_id=', variables('XXXXXSessionToken') )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;{
    "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": []
    }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When run I get the following error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Failure happened on 'Source' side. ErrorCode=RestCallFailedWithClientError,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,&lt;BR /&gt;Message=Rest call failed with client error, status code 401 Unauthorized, please check your activity settings.&lt;BR /&gt;Request URL: &lt;A href="https://XXXXX.RESTAPI.us/platformapi/core/system/applicationinfo/version" target="_blank" rel="noopener"&gt;https://XXXXX.RESTAPI.us/platformapi/core/system/applicationinfo/version&lt;/A&gt;.&lt;BR /&gt;Response: ,Source=Microsoft.DataTransfer.ClientLibrary,'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Question:&lt;/P&gt;&lt;P&gt;How do I configure this call using the data factory objects?&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What should the Linked Service look like?&amp;nbsp; &amp;nbsp;and what should the Source Data Set look like?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks for your kind attention to this matter.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;KD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 26 Jun 2025 21:05:58 GMT</pubDate>
    <dc:creator>KBD</dc:creator>
    <dc:date>2025-06-26T21:05:58Z</dc:date>
    <item>
      <title>pulling data from a REST API via Linked Service &amp; Copy object</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/pulling-data-from-a-REST-API-via-Linked-Service-amp-Copy-object/m-p/4745723#M8110</link>
      <description>&lt;P&gt;Hello All:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have been tasked with pulling data from a REST API , munging it and making it available for reporting (Power BI).&lt;/P&gt;&lt;P&gt;I have a the calls required working in POSTMAN and via Python from my desktop.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now I need to move this processing to Azure.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have gotten a couple of things to work.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Referring to the above:&lt;/P&gt;&lt;P&gt;Use a Web object to get a session token - required for all subsequent calls&amp;nbsp; proof I have correct URL , User Id &amp;amp; Password.&lt;/P&gt;&lt;P&gt;Use Set objects to set variables with values from the results.&amp;nbsp; Session Token is important.&lt;/P&gt;&lt;P&gt;Use Copy object to write out results&lt;/P&gt;&lt;P&gt;Web objects to simple calls to REST API&amp;nbsp; to prove session token returned is valid.&lt;/P&gt;&lt;P&gt;This works fine.&amp;nbsp; &amp;nbsp;Progress&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The REST copy data object is failing.&amp;nbsp; I want to use Copy data because I read it can handle pagination.&lt;/P&gt;&lt;P&gt;Some of the result data sets require multiple calls.&amp;nbsp; Larger than the record limit set on the API.&lt;/P&gt;&lt;P&gt;There are parameters on the Copy object for pagination.&amp;nbsp; But we are not there yet.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;POSTMAN generates this python code:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;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)&lt;/LI-CODE&gt;&lt;P&gt;this works.&amp;nbsp; The REST API expects those headers.&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is what I created in data factory&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;Linked Service&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Linked Service&lt;/P&gt;&lt;LI-CODE lang="python"&gt;{
    "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"
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data Set&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Default value is:&lt;/P&gt;&lt;P&gt;@concat('XXXXX session_id=', variables('XXXXXSessionToken') )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;{
    "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": []
    }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When run I get the following error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Failure happened on 'Source' side. ErrorCode=RestCallFailedWithClientError,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,&lt;BR /&gt;Message=Rest call failed with client error, status code 401 Unauthorized, please check your activity settings.&lt;BR /&gt;Request URL: &lt;A href="https://XXXXX.RESTAPI.us/platformapi/core/system/applicationinfo/version" target="_blank" rel="noopener"&gt;https://XXXXX.RESTAPI.us/platformapi/core/system/applicationinfo/version&lt;/A&gt;.&lt;BR /&gt;Response: ,Source=Microsoft.DataTransfer.ClientLibrary,'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Question:&lt;/P&gt;&lt;P&gt;How do I configure this call using the data factory objects?&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What should the Linked Service look like?&amp;nbsp; &amp;nbsp;and what should the Source Data Set look like?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks for your kind attention to this matter.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;KD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jun 2025 21:05:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/pulling-data-from-a-REST-API-via-Linked-Service-amp-Copy-object/m-p/4745723#M8110</guid>
      <dc:creator>KBD</dc:creator>
      <dc:date>2025-06-26T21:05:58Z</dc:date>
    </item>
    <item>
      <title>Re: pulling data from a REST API via Linked Service &amp; Copy object</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/pulling-data-from-a-REST-API-via-Linked-Service-amp-Copy-object/m-p/4752430#M8132</link>
      <description>&lt;P&gt;In the end I did not do the parameterization on the linked service,&lt;/P&gt;&lt;P&gt;Set the Authentication Type on the linked service to Anonymous.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then on the Copy Object in Additional Headers set the session key there:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dynamic content looks like this:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;WafaStudies out on YouTube has some videos which provide valuable pointers&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;KD&lt;/P&gt;</description>
      <pubDate>Thu, 03 Jul 2025 15:27:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/pulling-data-from-a-REST-API-via-Linked-Service-amp-Copy-object/m-p/4752430#M8132</guid>
      <dc:creator>KBD</dc:creator>
      <dc:date>2025-07-03T15:27:40Z</dc:date>
    </item>
  </channel>
</rss>

