Forum Discussion
Login failed while configuring Azure SQL connector
Hello All,
I'm trying to play with the Microsoft Graph connectors and trying to set up my first conector.
I decided to use the Microsoft Azure SQL connector and went through the guides in Microsoft Learn
https://learn.microsoft.com/en-us/microsoftsearch/mssql-connector
https://learn.microsoft.com/en-us/microsoftsearch/configure-connector
I created an Azure SQL Server and Database, registered the app and even put the app user as admin,
I create an external user using the SQL
CREATE USER [app name] FROM EXTERNAL PROVIDER
and exec sp_addrolemember 'db_datareader', [app name]'
Using SQL managment studio I'm able to connect to the SQL but when I try to configure the connector in the admin center I'm stuck on the Database settings screen, after selecting the "Test Connection" button I got the error message: "Error from database server: Login failed for user ''. Incorrect or invalid token."
Thanks,
Jonathan
1 Reply
- Sira1819Copper Contributor
Hey JonathanYeg,
Please grant permission to your registered app in Azure SQL.
To add the registered app to your Azure SQL Database, you need to:
- Log in to your Azure SQL DB
- Open a new query window
- Create a new user by running the command 'CREATE USER [app name] FROM EXTERNAL PROVIDER'
- Add user to role by running command 'exec sp_addrolemember 'db_datareader', [app name]'
Microsoft Reference - https://learn.microsoft.com/en-us/microsoftsearch/mssql-connector