Skip to main content
Question

Bot can't authenticate to Azure Synapse Serverless via ODBC Driver 18 service principal (AADSTS7000215), same secret works in our BI Tool

  • September 28, 2026
  • 1 reply
  • 40 views

I'm trying to connect an unattended bot directly to an Azure Synapse Analytics serverless SQL pool (the Synapse Link for Dynamics 365 F&O database) so it can run validation queries. The same database already works in our BI Tool using an Entra ID service principal (client ID and client secret). I want the bot to connect the same way, through either Database → Connect or an ODBC DSN

1 reply

KhaledMostafaMe
Most Valuable Pathfinder
Forum|alt.badge.img+2

Hello ​@scoffin06 

The error AADSTS7000215 means Entra ID rejected the client secret. Since it already works in your BI tool, check these two ODBC-specific culprits:

  1. Unescaped Special Characters: ODBC uses ; as a parameter delimiter. If the secret contains ;, {, or }, wrap the entire secret in curly braces:

    PWD={YourClientSecretHere};

    If the secret includes a closing brace }, escape it by doubling it: }}

  2. Missing Tenant ID: Unlike BI tools that infer or prompt for your tenant, generic ODBC Driver 18 defaults to the common endpoint unless specified. Explicitly include your Azure Tenant GUID

    TenantId=<Your-Tenant-GUID>;

Working Connection String Template:

Driver={ODBC Driver 18 for SQL Server};Server=<workspace>-ondemand.sql.azuresynapse.net,1433;Database=<db-name>;Authentication=ActiveDirectoryServicePrincipal;UID=<App-Client-ID>;PWD={<Client-Secret>};TenantId=<Tenant-GUID>;Encrypt=yes;TrustServerCertificate=no;

Also ensure no trailing spaces were copied into the Credential Locker, and that any DSN used is created in the 64-bit ODBC Administrator