Ability to query Azure Users/Groups via SQL Server

ggusr 1 Reputation point
2022-02-18T16:14:04.693+00:00

Hello!

I am working to provide live data from our Users & Groups page on Azure to build a small application for my support team. Is it possible to query this data from the Azure portal from my SQL Server instance in any way?

Thank you in advance

SQL Server | Other
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Ronen Ariely 15,216 Reputation points
    2022-02-18T17:05:06.117+00:00

    hi,

    I am working to provide live data from our Users & Groups page on Azure to build a small application for my support team.

    Are you speaking about users and groups in Azure Active Directory or in the Azure SQL database level?

    Is it possible to query this data from the Azure portal from my SQL Server instance in any way?

    Yes

    • I assume that you speak about Azure SQL logical server.

    You can execute queries on Azure SQL Database from the portal

    (1) Go to the list of logical servers
    https://portal.azure.com/#blade/HubsExtension/BrowseResource/resourceType/microsoft.sql%2Fservers

    (2) Click on the server which you ant to use

    (3) Navigate to the database that you want to use

    (4) n the left menu you have new option: Query Editor

    175865-image.png


  2. AmeliaGu-MSFT 14,011 Reputation points Microsoft External Staff
    2022-02-21T06:34:20.43+00:00

    Hi ggusr-4236,
    Sorry I’m not familiar with Azure AD.
    Here is a similar thread which might be helpful:

    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.

    Best Regards,
    Amelia


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.