Cannot like azure SQL Database to ADF using user-assigned managed identity Here are the steps:
CREATE USER [<identity-name>] FROM EXTERNAL PROVIDER;
ALTER ROLE db_datareader ADD MEMBER [<identity-name>];
ALTER ROLE db_datawriter ADD MEMBER [<identity-name>];
ALTER ROLE db_ddladmin ADD MEMBER [<identity-name>];
GO
But cannot connect to the SQL server, and here is the exception name and details: Error Code: InvalidCredentialReference Details: Invalid credential reference. Name: credential1
Would like to connect SQL database from ADF
First you need to add your user assigned managed identity to ADF Managed identities:
Go to the settings >> Managed identities >> select the User-assigned >> Add and add your user-assigned managed identity to ADF.
Create credential in ADF:
Now create credential in ADF to use authentication type as User Assigned Managed Identity. While creating credential in ADF add user assigned managed identity which is assigned to ADF by adding it into ADF Managed identities (as we did in above process).
Create user for User Assigned Managed Identity:
Now, create user in SQL and assign proper role for User Assigned Managed Identity in Azure SQL with below commands:
CREATE USER [UAMI] FROM EXTERNAL PROVIDER;
ALTER ROLE db_datawriter ADD MEMBER [UAMI];
ALTER ROLE db_datareader ADD MEMBER [UAMI];
Now connect with this credential to your SQL using User Assigned Managed Identity