Last post Nov 19, 2019 07:13 PM by chiuchowyan
Nov 18, 2019 07:26 PM|chiuchowyan|LINK
I am not a programmer but just want to understand the following situation when it comes to connecting to web api, e.g. Microsoft Graph.
Assuming I have an MS SQL database which stores company's user information. I also have an Aure AD subscription for users in the same company.
If I want to update user information on the Azure AD based on the SQL database (be it new user creation or modification), what technology can be implemented to detect the database change and send webapi request to Graph? I am not asking any specific technical
details, what will be used for this implementation.
I am not taking authentication\authorization in this. This is purely for user creation\modification.
Nov 19, 2019 05:34 AM|Fei Han - MSFT|LINK
Welcome to ASP.NET forums.
what technology can be implemented to detect the database change and send webapi request to Graph?
To detect changes to database table(s), you can try to use triggers:
Besides, if you'd like to make request to API endpoint from SQL server, you can try to use SQL CLR stored procedure.
Nov 19, 2019 06:14 PM|chiuchowyan|LINK
I assumed we have to run the SQL stored procedure like a service running at the background so that it can post the API request whenever it sees the change from the SQL database. Do you know how I can achieve that? My understanding with stored procedure
is that you can either manually run it or schedule it using SQL job agent. But that will not be instantaneous.
Nov 19, 2019 06:19 PM|bruce (sqlwork.com)|LINK
to use SQLDependency, you will need a continuously running job, say as a NT service. If you use SQL Agent, you can just use polling (run the job every minute or so). to poll you need timestamps and soft deletes.
Nov 19, 2019 07:13 PM|chiuchowyan|LINK
Thanks Bruce and Fei for your help on this. I think I know how to proceed now.