An Azure analytics service that brings together data integration, enterprise data warehousing, and big data analytics. Previously known as Azure SQL Data Warehouse.
Use a REST linked service with Anonymous auth and parameterized headers, then drive it from a ForEach.
High-level pattern in Synapse/ADF:
- Use Web activity to get bearer token (already done).
- Use Web activity (or Key Vault) to get subscription key (already done).
- Store both values in pipeline variables or pass them directly as expressions.
- Create a REST linked service with
authenticationType = Anonymous. - In the REST dataset (or directly in the Copy activity source), set
additionalHeadersusing dynamic content that injects the token and subscription key. - Use a ForEach activity over the array of
resourcePaths, and inside it run a Copy activity whose relative URL is built from the loop item.
Details from the REST connector and Web activity behavior:
- REST connector supports Anonymous auth and custom headers via
authHeaders/additionalHeaders:- Anonymous is appropriate when the header must carry the bearer token and subscription key instead of using built-in auth types.
- Copy activity with REST source/sink supports custom headers via
additionalHeaders.
- Web activity and REST connector both require JSON responses; REST source supports JSON payloads.
Example configuration outline
- REST linked service (JSON, via code or UI equivalent):
{
"name": "LS_RestApi",
"properties": {
"type": "RestService",
"typeProperties": {
"url": "https://your-base-url",
"authenticationType": "Anonymous"
}
}
}
- REST dataset (optional) or inline source in Copy activity:
In the Copy activity → Source → Additional headers (UI) or additionalHeaders (JSON), use dynamic content:
"additionalHeaders": {
"Authorization": "@concat('Bearer ', pipeline().variables.accessToken)",
"Ocp-Apim-Subscription-Key": "@pipeline().variables.subscriptionKey"
}
Where accessToken and subscriptionKey are pipeline variables set from the Web activities’ outputs, for example:
- After token Web activity (name:
GetToken):
@activity('GetToken').output.access_token
- After subscription key Web activity (name:
GetSubKey):
@activity('GetSubKey').output.yourKeyField
- ForEach over endpoints
- Create an array parameter or variable
resourcePathsthat contains the endpoint names. - ForEach items:
@pipeline().parameters.resourcePaths(or variable equivalent). - Inside ForEach, Copy activity source relative URL:
"relativeUrl": "@concat('yourContextPath/', item())"
The REST connector will then call:
{base url from linked service}/{relativeUrl}
with the headers defined in additionalHeaders, which include the bearer token and subscription key.
- Sink to storage
- Configure the Copy activity sink as your storage (e.g., Azure Blob/ADLS) and use dynamic file names based on
item()so each endpoint’s data is written to a separate file.
This approach reproduces the PowerShell logic:
- Token acquisition → Web activity.
- Header construction → dynamic
additionalHeadersusing pipeline expressions. - Loop over endpoints → ForEach with
item(). - Download JSON and save to storage → Copy activity REST source → storage sink.
References: