Unable to use Salesforce OAuth 2.0 connector in the Azure pipeline

Nimesh Raj Manandhar 41 Reputation points
2024-10-07T23:33:58.6366667+00:00

I am trying to switch from the legacy Azure Salesforce Data Connector to a newer Salesforce OAuth 2.0 connector. I have had the SFDC admins register the app to obtain the Client ID and Secret. I have used this new info (Client ID and Secret) to create a new linked service and had successful result. I can preview the data in the linked service by providing the object name. However when I try to run it through the pipeline, I get the following error. My first step in the pipeline is to get the max (LastModifiedDate) value using a query option (in the legacy connector) and SOQL option in the new connector. So, what am I doing wrong?

Failure happened on 'Source' side. ErrorCode=SalesforceHttpResponseNotSuccessCodeException,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=The API request to Salesforce failed. Request Url: https://XXXX.my.salesforce.com/services/data/v53.0/jobs/query, Status Code: BadRequest, Error message: [{"errorCode":"INVALIDJOB","message":"Query parsing error: unexpected token: 'as'"}],Source=Microsoft.Connectors.Salesforce,'

User's image

User's image

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

Accepted answer
  1. phemanth 11,455 Reputation points Microsoft Vendor
    2024-10-08T02:22:41.3833333+00:00

    @Nimesh Raj Manandhar

    Thanks for reaching out to Microsoft Q&A

    It looks like you’re encountering a query parsing error when using the new Salesforce OAuth 2.0 connector in your Azure pipeline. The error message indicates that there’s an issue with the SOQL query syntax,

    specifically an unexpected token: ‘as’.

    Here are a few steps you can take to troubleshoot and resolve this issue:

    1. Check the SOQL Query Syntax: Ensure that your SOQL query is correctly formatted. Salesforce SOQL does not support the AS keyword for aliasing columns, unlike SQL.
    2. Review the API Version: Make sure that the API version you’re using in the request URL (v53.0 in your case) is compatible with the features and syntax you’re using in your SOQL query.
    3. Pipeline Configuration: Double-check the configuration of your pipeline step that executes the SOQL query. Ensure that the query is correctly passed to the connector without any modifications that might introduce syntax errors.
    4. Error Handling: Implement error handling in your pipeline to capture and log detailed error messages. This can help you identify the exact point of failure and the nature of the error.

    Refer to the Salesforce SOQL documentation for detailed syntax rules: https://developer.salesforce.com/docs

    If you’ve checked all these and the issue persists, please do let us know

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.