Invoke-SqlCmd using token to connect to Azure Synapse dedicated or serverless sql pool

Lorrin Ferdinand 1 Reputation point Microsoft Employee
2022-03-12T12:22:44.867+00:00

Hello,

Requirement: Add a contained database user for an Azure AD group to the database hosted by a dedicated or serverless sql pool on Azure Synapse Analytics workspace using powershell in an azure pipeline (automated)

Problem Statement: When attempting to do this, we first obtain a token, but invariably, regardless of the endpoint from which we obtain the token, we are getting "Login Failed for Token-Identified principal". We are using the service principal backing the Service Connection. This SPN is the Azure AD SQL Administrator on the Synapse Workspace.

Details:
Endpoints tested:

  1. https://management.azure.com
  2. https://dev.azuresynapse.net
  3. https://sql.azuresynapse.net
  4. https://database.windows.net

Is this connection method (i.e. using token) supported for Azure Synapse?
Is there an unpublished endpoint that I should be using?

Any assistance with this is greatly appreciated!

Azure Synapse Analytics
Azure Synapse Analytics
An Azure analytics service that brings together data integration, enterprise data warehousing, and big data analytics. Previously known as Azure SQL Data Warehouse.
4,396 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Oliveira, Magno (NonEmp) 1 Reputation point
    2022-05-18T21:25:38.263+00:00

    Hey @Lorrin Ferdinand could you share the solution? We are facing the same problem.