Skip to content

Commit 4e037c6

Browse files
authored
Merge pull request #267073 from v-luckywang/0223-Improvement_salesforce_v2
[Doc update] - Add includeDeletedObjects for Salesforce and Salesforce Service Cloud
2 parents b6b53ad + fc9d996 commit 4e037c6

14 files changed

+94
-12
lines changed

articles/data-factory/TOC.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1262,6 +1262,9 @@ items:
12621262
- name: REST
12631263
href: connector-troubleshoot-rest.md
12641264
displayName: troubleshooting
1265+
- name: Salesforce and Salesforce Service Cloud
1266+
href: connector-troubleshoot-salesforce.md
1267+
displayName: troubleshooting
12651268
- name: SAP Table, SAP Business Warehouse Open Hub, and SAP ODP
12661269
href: connector-troubleshoot-sap.md
12671270
displayName: troubleshooting

articles/data-factory/connector-salesforce-service-cloud.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@ For a list of data stores that are supported as sources or sinks, see the [Suppo
3737
Specifically, this Salesforce Service Cloud connector supports:
3838

3939
- Salesforce Developer, Professional, Enterprise, or Unlimited editions.
40-
- Copying data from and to custom domain (Custom domain can be configured in both production and sanbox environments).
40+
- Copying data from and to custom domain (Custom domain can be configured in both production and sandbox environments).
4141

4242
You can explicitly set the API version used to read/write data via [`apiVersion` property](#linked-service-properties) in linked service. When copying data to Salesforce Service Cloud, the connector uses BULK API 2.0.
4343

4444

4545
## Prerequisites
4646

4747
- API permission must be enabled in Salesforce.
48-
- You need configure the Connected Apps in Salesforce portal referring to this [article](https://help.salesforce.com/s/articleView?id=sf.connected_app_client_credentials_setup.htm&type=5)
48+
- You need configure the Connected Apps in Salesforce portal referring to this [official doc](https://help.salesforce.com/s/articleView?id=sf.connected_app_client_credentials_setup.htm&type=5) or our step by step guideline in the recommendation in this [article](connector-troubleshoot-salesforce.md#error-code-salesforceoauth2clientcredentialfailure).
4949

5050
>[!IMPORTANT]
5151
> - The execution user must have the API Only permission.
@@ -204,7 +204,8 @@ To copy data from Salesforce Service Cloud, set the source type in the copy acti
204204
| Property | Description | Required |
205205
|:--- |:--- |:--- |
206206
| type | The type property of the copy activity source must be set to **SalesforceServiceCloudV2Source**. | Yes |
207-
| SOQLQuery | Use the custom query to read data. You can only use [Salesforce Object Query Language (SOQL)](https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql.htm) query with [limitations](https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/queries.htm#SOQL%20Considerations). If query is not specified, all the data of the Salesforce object specified in "ObjectApiName/reportId" in dataset will be retrieved. | No (if "ObjectApiName/reportId" in the dataset is specified) |
207+
| SOQLQuery | Use the custom query to read data. You can only use [Salesforce Object Query Language (SOQL)](https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql.htm) query with limitations. For SOQL limitations, see this [article](https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/queries.htm#SOQL%20Considerations). If query is not specified, all the data of the Salesforce object specified in "ObjectApiName/reportId" in dataset will be retrieved. | No (if "ObjectApiName/reportId" in the dataset is specified) |
208+
| includeDeletedObjects | Indicates whether to query the existing records, or query all records including the deleted ones. If not specified, the default behavior is false. <br>Allowed values: **false** (default), **true**. | No |
208209

209210
> [!IMPORTANT]
210211
> The "__c" part of **API Name** is needed for any custom object.
@@ -233,7 +234,8 @@ To copy data from Salesforce Service Cloud, set the source type in the copy acti
233234
"typeProperties": {
234235
"source": {
235236
"type": "SalesforceServiceCloudV2Source",
236-
"SOQLQuery": "SELECT Col_Currency__c, Col_Date__c, Col_Email__c FROM AllDataType__c"
237+
"SOQLQuery": "SELECT Col_Currency__c, Col_Date__c, Col_Email__c FROM AllDataType__c",
238+
"includeDeletedObjects": false
237239
},
238240
"sink": {
239241
"type": "<sink type>"
@@ -324,15 +326,17 @@ When you copy data from Salesforce Service Cloud, the following mappings are use
324326

325327
To learn details about the properties, check [Lookup activity](control-flow-lookup-activity.md).
326328

327-
## Migrate the Salesforce Service Cloud linked service
329+
## Upgrade the Salesforce Service Cloud linked service
328330

329-
Migrating your Salesforce Service Cloud linked service is highly recommended if you use the legacy version. Take the following steps:
331+
Here are steps that help you upgrade your linked service and related queries:
330332

331333
1. Configure the connected apps in Salesforce portal by referring to [Prerequisites](connector-salesforce-service-cloud.md#prerequisites).
332334

333335
1. Create a new Salesforce Service Cloud linked service and configure it by referring to [Linked service properties](connector-salesforce-service-cloud.md#linked-service-properties).
334336

335337
1. If you use SQL query in the copy activity source or the lookup activity that refers to the legacy linked service, you need to convert them to the SOQL query. Learn more about SOQL query from [Salesforce Service Cloud as a source type](connector-salesforce-service-cloud.md#salesforce-service-cloud-as-a-source-type) and [Salesforce Object Query Language (SOQL)](https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql.htm).
336338

339+
1. readBehavior is replaced with includeDeletedObjects in the copy activity source or the lookup activity. For the detailed configuration, see [Salesforce Service Cloud as a source type](connector-salesforce-service-cloud.md#salesforce-service-cloud-as-a-source-type).
340+
337341
## Related content
338342
For a list of data stores supported as sources and sinks by the copy activity, see [Supported data stores](copy-activity-overview.md#supported-data-stores-and-formats).

articles/data-factory/connector-salesforce.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@ For a list of data stores that are supported as sources or sinks, see the [Suppo
3737
Specifically, this Salesforce connector supports:
3838

3939
- Salesforce Developer, Professional, Enterprise, or Unlimited editions.
40-
- Copying data from and to custom domain (Custom domain can be configured in both production and sanbox environments).
40+
- Copying data from and to custom domain (Custom domain can be configured in both production and sandbox environments).
4141

4242
You can explicitly set the API version used to read/write data via [`apiVersion` property](#linked-service-properties) in linked service. When copying data to Salesforce, the connector uses BULK API 2.0.
4343

4444

4545
## Prerequisites
4646

4747
- API permission must be enabled in Salesforce.
48-
- You need configure the Connected Apps in Salesforce portal referring to this [article](https://help.salesforce.com/s/articleView?id=sf.connected_app_client_credentials_setup.htm&type=5)
48+
- You need configure the Connected Apps in Salesforce portal referring to this [official doc](https://help.salesforce.com/s/articleView?id=sf.connected_app_client_credentials_setup.htm&type=5) or our step by step guideline in the recommendation in this [article](connector-troubleshoot-salesforce.md#error-code-salesforceoauth2clientcredentialfailure).
4949

5050
>[!IMPORTANT]
5151
> - The execution user must have the API Only permission.
@@ -249,7 +249,8 @@ To copy data from Salesforce, set the source type in the copy activity to **Sale
249249
| Property | Description | Required |
250250
|:--- |:--- |:--- |
251251
| type | The type property of the copy activity source must be set to **SalesforceV2Source**. | Yes |
252-
| SOQLQuery | Use the custom query to read data. You can only use [Salesforce Object Query Language (SOQL)](https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql.htm) query with [limitations](https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/queries.htm#SOQL%20Considerations). If query is not specified, all the data of the Salesforce object specified in "ObjectApiName/reportId" in dataset will be retrieved. | No (if "ObjectApiName/reportId" in the dataset is specified) |
252+
| SOQLQuery | Use the custom query to read data. You can only use [Salesforce Object Query Language (SOQL)](https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql.htm) query with limitations. For SOQL limitations, see this [article](https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/queries.htm#SOQL%20Considerations). If query is not specified, all the data of the Salesforce object specified in "ObjectApiName/reportId" in dataset will be retrieved. | No (if "ObjectApiName/reportId" in the dataset is specified) |
253+
| includeDeletedObjects | Indicates whether to query the existing records, or query all records including the deleted ones. If not specified, the default behavior is false. <br>Allowed values: **false** (default), **true**. | No |
253254

254255
> [!IMPORTANT]
255256
> The "__c" part of **API Name** is needed for any custom object.
@@ -278,7 +279,8 @@ To copy data from Salesforce, set the source type in the copy activity to **Sale
278279
"typeProperties": {
279280
"source": {
280281
"type": "SalesforceV2Source",
281-
"SOQLQuery": "SELECT Col_Currency__c, Col_Date__c, Col_Email__c FROM AllDataType__c"
282+
"SOQLQuery": "SELECT Col_Currency__c, Col_Date__c, Col_Email__c FROM AllDataType__c",
283+
"includeDeletedObjects": false
282284
},
283285
"sink": {
284286
"type": "<sink type>"
@@ -369,15 +371,17 @@ When you copy data from Salesforce, the following mappings are used from Salesfo
369371

370372
To learn details about the properties, check [Lookup activity](control-flow-lookup-activity.md).
371373

372-
## Migrate the Salesforce linked service
374+
## Upgrade the Salesforce linked service
373375

374-
Migrating your Salesforce linked service is highly recommended if you use the legacy version. Take the following steps:
376+
Here are steps that help you upgrade your linked service and related queries:
375377

376378
1. Configure the connected apps in Salesforce portal by referring to [Prerequisites](connector-salesforce.md#prerequisites).
377379

378380
1. Create a new Salesforce linked service and configure it by referring to [Linked service properties](connector-salesforce.md#linked-service-properties).
379381

380382
1. If you use SQL query in the copy activity source or the lookup activity that refers to the legacy linked service, you need to convert them to the SOQL query. Learn more about SOQL query from [Salesforce as a source type](connector-salesforce.md#salesforce-as-a-source-type) and [Salesforce Object Query Language (SOQL)](https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql.htm).
381383

384+
1. readBehavior is replaced with includeDeletedObjects in the copy activity source or the lookup activity. For the detailed configuration, see [Salesforce as a source type](connector-salesforce.md#salesforce-as-a-source-type).
385+
382386
## Related content
383387
For a list of data stores supported as sources and sinks by the copy activity, see [Supported data stores](copy-activity-overview.md#supported-data-stores-and-formats).

articles/data-factory/connector-troubleshoot-guide.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ You can refer to the troubleshooting pages for each connector to see problems sp
3636
- [ORC format](connector-troubleshoot-orc.md)
3737
- [Parquet format](connector-troubleshoot-parquet.md)
3838
- [REST](connector-troubleshoot-rest.md)
39+
- [Salesforce and Salesforce Service Cloud](connector-troubleshoot-salesforce.md)
3940
- [SharePoint Online list](connector-troubleshoot-sharepoint-online-list.md)
4041
- [XML format](connector-troubleshoot-xml.md)
4142

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
---
2+
title: Troubleshoot the Salesforce and Salesforce Service Cloud connectors
3+
titleSuffix: Azure Data Factory & Azure Synapse
4+
description: Learn how to troubleshoot issues with the Salesforce and Salesforce Service Cloud connectors in Azure Data Factory and Azure Synapse Analytics.
5+
author: jianleishen
6+
ms.service: data-factory
7+
ms.subservice: data-movement
8+
ms.topic: troubleshooting
9+
ms.date: 03/04/2024
10+
ms.author: jianleishen
11+
ms.custom: has-adal-ref, synapse
12+
---
13+
14+
# Troubleshoot the Salesforce and Salesforce Service Cloud connectors in Azure Data Factory and Azure Synapse
15+
16+
[!INCLUDE[appliesto-adf-asa-md](includes/appliesto-adf-asa-md.md)]
17+
18+
This article provides suggestions to troubleshoot common problems with the Salesforce and Salesforce Service Cloud connectors in Azure Data Factory and Azure Synapse.
19+
20+
## Error code: SalesforceOauth2ClientCredentialFailure
21+
22+
- **Cause**: You encounter this error code as you don't complete the Salesforce Connected App configuration.
23+
24+
- **Recommendation**: <br/>To configure your Salesforce Connected App, follow these steps:
25+
1. Create your connected app, and complete its [basic information](https://help.salesforce.com/s/articleView?id=sf.connected_app_create_basics.htm&type=5) and [OAuth settings](https://help.salesforce.com/s/articleView?id=sf.connected_app_create_api_integration.htm&type=5) for the connected app.
26+
1. Configure the **Connected App Name**, **API Name** and **Contact Email**.
27+
1. Select **Enable OAuth Settings**.
28+
1. Callback url can be random as Client Credential Flow don't need callback, for example: `https://login.salesforce.com/services/oauth2/callback`
29+
1. Setup OAuth access token scope, it's better to set up "**Full access**" for Azure Data Factory in case of permission issue.
30+
<br/>If you want to keep the mini scope, at least the "**Manage user data via APIs (api)**" should be added.
31+
<br/>If you don't set proper scope, you may get following similar message like: **Unauthorized, This session is not valid for use with the REST API**
32+
1. Select **Enable Client Credentials Flow**.
33+
34+
:::image type="content" source="media/connector-salesforce/configure-basic-information.png" alt-text="Screenshot of configuring basic information for the Salesforce connector app.":::
35+
36+
1. Get Client ID and Secret through **Manage Consumer Details**.
37+
38+
:::image type="content" source="media/connector-salesforce/manage-consumer-details.png" alt-text="Screenshot of the manage consumer details.":::
39+
40+
1. Copy the client ID and secret to a txt file for Azure Data Factory linked service.
41+
42+
:::image type="content" source="media/connector-salesforce/client-id-secret.png" alt-text="Screenshot of the Client ID and Secret.":::
43+
44+
1. Create a user who has the API Only User permission.
45+
46+
1. Set up a permission set which only has API only permission.
47+
:::image type="content" source="media/connector-salesforce/set-up-a-permission.png" alt-text="Screenshot of setting system permissions.":::
48+
1. Specify the **API Enabled** and **Api Only User**.
49+
:::image type="content" source="media/connector-salesforce/system-permissions.png" alt-text="Screenshot of the system permissions.":::
50+
51+
1. Create a new user and link the permission set in the user detail page: **Permission Set Assignments**.
52+
:::image type="content" source="media/connector-salesforce/permission-set-assignments.png" alt-text="Screenshot of the permission set assignments.":::
53+
54+
1. From the connected app detail page, click Manage, click **Edit Policies**. For **Run As**, select an execution user who has the API Only User permission. For **Timeout Value**, you can select a proper value or remain default None.
55+
56+
:::image type="content" source="media/connector-salesforce/connected-app-detail.png" alt-text="Screenshot of the connected app detail.":::
57+
58+
:::image type="content" source="media/connector-salesforce/edit-policies.png" alt-text="Screenshot of the edit policies.":::
59+
60+
## Related content
61+
62+
For more troubleshooting help, try these resources:
63+
64+
- [Connector troubleshooting guide](connector-troubleshoot-guide.md)
65+
- [Data Factory blog](https://techcommunity.microsoft.com/t5/azure-data-factory-blog/bg-p/AzureDataFactoryBlog)
66+
- [Data Factory feature requests](/answers/topics/azure-data-factory.html)
67+
- [Azure videos](https://azure.microsoft.com/resources/videos/index/?sort=newest&services=data-factory)
68+
- [Microsoft Q&A page](/answers/topics/azure-data-factory.html)
69+
- [Stack Overflow forum for Data Factory](https://stackoverflow.com/questions/tagged/azure-data-factory)
70+
- [Twitter information about Data Factory](https://twitter.com/hashtag/DataFactory)
37.4 KB
Loading
36 KB
Loading
215 KB
Loading
37.4 KB
Loading
84.5 KB
Loading

0 commit comments

Comments
 (0)