DotNetMatt
DotNetMatt

Reputation: 688

Is it possible to query Azure Active Directory from an on-premises SQL Server?

I currently have an on-premises Active Directory and on-premises SQL Server. Using a linked server and OpenQuery we are able to query the AD from SQL Server.

As we are transitioning to the cloud, is it possible to do the same with an on-premises SQL Server and Azure Active Directory? If yes, any idea how?

EDIT: Scenario: we have a stored procedure running every x hours that retrieves user data from the on-premises Active Directory.

Upvotes: 0

Views: 2256

Answers (1)

AnshuBhola
AnshuBhola

Reputation: 206

I would use Graph API's to get the user info from Azure AD and dump it into any staging table. Now you can use this staging table in your stored procedure.

https://learn.microsoft.com/en-us/azure/active-directory/develop/active-directory-graph-api

Differential Query can be used to optimize the Graph API calls.

Upvotes: 2

Related Questions