r/SQLServer • u/watchoutfor2nd • Dec 31 '25
Question Trouble setting up linked server using entra service principal auth
I'd like to set up a linked server using entra service principal auth. In my test environment I am running SQL 2025 which should support this but when following MS documentation on this I can't get it to work. Specifically I'm following instructions in the Linked server configuration using access token authentication section. Originally I has the service principal inside an entra group which was given SQL permissions, but as part of troubleshooting I created a server login for this SP directly and assigned permissions to it. Has anyone been able to get this working? Any help is appreciated.
•
u/AutoModerator Dec 31 '25
After your question has been solved /u/watchoutfor2nd, please reply to the helpful user's comment with the phrase "Solution verified".
This will not only award a point to the contributor for their assistance but also update the post's flair to "Solved".
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
2
u/Jeffinmpls Dec 31 '25 edited Dec 31 '25
Need more Info!
Are you creating this from an OnPrem 2025 instance to a Azure SQL database? Has the service principle/app registration had both a login and user created on master /database and been given read?
For step 5 did you use the correct id from the service principle, should be the client ID
Are you able to connect directly to the database in SSMS(edit using the service principle)? If you can't do that, then you definitely can't set up
2
u/dbrownems Microsoft Employee Dec 31 '25
I've done it and it works fine. Test with SSMS 2022 which also supports Service Principal auth.
1
u/SirGreybush 1 Dec 31 '25
If each server can see each other and both have the appropriate ports open - some companies setup a VLAN and thus two servers on different LANs and the same router might not work.
Check with your IT guru / network security guy.
Cross check with SSMS on each server by doing a console RDP and manually connecting from Server A to Server B.
If it doesn’t work, the port isn’t open between the two.
I can from Azure VM do a LS to an on-prem server, and vice-versa, using AD credentials. But the security guru had to set it up. Plus I had to convince him that I needed this.
I used the ELT excuse. SSIS / ADF runs in Azure, not on prem.
I won because the Azure is the backup domain controller. So it was secure. I also enabled encrypted connection.
1
u/CPDRAGMEISH Jan 01 '26
Before anything else in
SSMS create the login such
Then create the l. server with this login.