How to grant read access to a function app on a Synapse serverless database

Razeen 0 Reputation points
2023-12-21T09:29:14.76+00:00

I'm struggling to execute queries against a Synapse serverless database from a function app using managed identity auth.

The SQL I've tried to create the user for that function app is as follows:

Attempt [1]

Database: <DB Name>

CREATE USER [<Function-App Name>] FROM EXTERNAL PROVIDER
ALTER ROLE [db_datareader] ADD MEMBER [<Function-App Name>]

 

Attempt [2]

Database: master

CREATE LOGIN [<Function-App Name>] FROM EXTERNAL PROVIDER

 

Database: <DB Name>

CREATE USER [<Function-App Name>] FROM LOGIN [<Function-App Name>]
ALTER ROLE [db_datareader] ADD MEMBER [<Function-App Name>]

The error I get on either is:

Cannot find the CREDENTIAL 'Managed_Identity', because it does not exist or you do not have permission.

Could you please provide a list of correct steps to grant access?

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.
{count} votes

Your answer

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