An Azure service for ingesting, preparing, and transforming data at scale.
Hi nishant garg,
A 403 Forbidden error in Copy Activity while the same API works in Postman and Web Activity usually indicates a difference in request headers, authentication configuration, or network routing in Azure Data Factory (ADF). Since the API works outside Copy Activity, the issue is typically related to dataset/linked service configuration or headers not being passed correctly.
Below are the recommended troubleshooting steps.
Step 1: Verify Authentication Configuration in REST Linked Service
Ensure the authentication method used in Postman is configured identically in ADF.
- Go to ADF → Manage → Linked Services.
Open the REST linked service used by the Copy Activity.
Verify the authentication type:
Anonymous
Basic
OAuth2
Managed Identity
Service Principal
If the API requires API key or token, ensure it is configured in Authentication or Additional Headers.
Step 2: Add Required Request Headers in the Dataset
Many APIs return 403 if required headers (for example Authorization, x-api-key, Accept, User-Agent) are missing.
Open the REST Dataset used in the Copy Activity.
Go to Connection / Request headers.
Add the same headers used in Postman.
Example:
Authorization : Bearer <token>
Accept : application/json
Content-Type : application/json
Step 3: Verify HTTP Method and Query Parameters
If the API requires GET parameters or specific method configuration, ensure they match Postman.
Open Copy Activity → Source tab.
Confirm:
HTTP method (GET/POST)
Query parameters
Relative URL
Even a missing parameter can result in 403 from API gateways.
Step 4: Check Integration Runtime Network Access
The response header shows:
Microsoft-Azure-Application-Gateway/v2
This suggests the API may have IP filtering enabled.
If the API allows only specific IP addresses:
- Identify the ADF Integration Runtime outbound IP.
- Add these IPs to the API allowlist / firewall.
Step 5: Compare Copy Activity vs Web Activity Request
Since Web Activity works, compare both configurations.
Open Web Activity → Output.
Capture headers and request format.
Replicate the same configuration in Copy Activity REST dataset.
This typically resolves issues where Copy Activity does not automatically include headers used by Web Activity.
Reference Link:
https://learn.microsoft.com/azure/data-factory/connector-rest
https://learn.microsoft.com/azure/data-factory/copy-activity-overview
https://learn.microsoft.com/azure/data-factory/connector-rest#request-headers
https://learn.microsoft.com/azure/data-factory/control-flow-web-activity
https://learn.microsoft.com/azure/data-factory/azure-integration-runtime-ip-addresses
Hope this helps. If you have any follow-up questions, please let me know. I would be happy to help.
Please do not forget to "up-vote" wherever the information provided helps you, as this can be beneficial to other community members.