Salesforce V2 Link Service doens't work. error message: a task was canceled Source=mscorlib

ChoiLiamhehimhis-5365 25 Reputation points
2024-05-16T13:35:58.54+00:00

I am migrating the ADF salesforce connector to the new V2 connector and now testing it.

When testing the connection for the link service, it is good.

However, it failed in the copy activity. with message:

Failure happened on 'Source' side. 'Type=System.Threading.Tasks.TaskCanceledException,Message=A task was canceled.,Source=mscorlib,'

Sometimes it works, and sometimes it fails.

I also enable the debug run in salesforce, it shows the query is with status 'completed'. But the SHIR doesn't receive any records from the source and the copy activity is failed.

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

1 answer

Sort by: Most helpful
  1. BhargavaGunnam-MSFT 28,106 Reputation points Microsoft Employee
    2024-05-16T20:18:59.35+00:00

    Hello Choi, Liam (he/him/his),

    Thanks for the additonal details.

    The new salesforce connector leverages bulk API for better user experience. But recently we did find there are some bugs when using SalesforceV2 connector comapring with legacy Salesforce connector.

    Workarounds:
    Please use Power Shell command to generate legacy Salesforce linked service and pipelines.

    https://learn.microsoft.com/en-us/powershell/module/az.datafactory/new-azdatafactorylinkedservice?view=azps-11.6.0&viewFallbackFrom=azps-11.2.0

    The salesforce related definiation can be found here. https://github.com/Azure/azure-rest-api-specs/blob/7e9e559d09a11686c132aaf4e1759b29f79517d7/specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/entityTypes/LinkedService.json#L2885C6-L2885C29

    (or)

    You can use UX feature flag '&feature.enableSalesforceV2=false' to temporarily switch back to legacy salesforce connector to unblock you here. In order to use the feature flag, just add above in data factory URL.

    If the new created linked service is with type 'Salesforce' rather than 'SalesforceV2', then it works.

    Please try this and let me know if you still having the issue.