Can i get the ID of a managed device from a registered web app using Graph API?

Peter Roddy 0 Reputation points
2024-07-01T20:37:19.3+00:00

I have an Azure app service web app registered with Entra ID. I want determine the name or ID of a managed on-prem device when an authenticated user signs into the Web app, which is running in the browser of the on-prem device. Is this possible? My goal is to display different apps from the Web App UI depending on whether the user accesses the Web app from a managed device or a personal device.

Azure Managed Applications
Azure Managed Applications
An Azure service that enables managed service providers, independent software vendors, and enterprise IT teams to deliver turnkey solutions through the Azure Marketplace or service catalog.
120 questions
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,269 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,290 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
20,371 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. akinbade abiola 7,515 Reputation points
    2024-07-01T23:25:25.9266667+00:00

    Hello Peter Roddy,

    Thanks for your question.

    I will suggest Azure AD Conditional Access policies and device compliance information.

    You could configure a policy that grants access to the web app only from devices marked as managed in Entra

    See: Create a device-based Conditional Access policy

    You can also Use compliance policies to set rules for devices you manage with Intune

    1. Sign in to the Microsoft Intune admin center.
    2. Go to Devices > Compliance policies > Create Policy.

    You can mark it 'Accept Answer' and 'Upvote' if this helped you

    Regards,

    Abiola

    0 comments No comments

  2. Akhilesh 6,985 Reputation points Microsoft Vendor
    2024-07-03T12:45:15.4466667+00:00

    Hi @Peter Roddy

    Thank you for reaching out!

    I understand that you would like to get the ID of a managed device from a registered web app using Graph API.

    You can get the List properties and relationships of the managedDevice objects.
    Here is an example of the request.

    GET https://graph.microsoft.com/v1.0/deviceManagement/managedDevices
    
    GET /deviceManagement/managedDevices
    GET /deviceManagement/detectedApps/{detectedAppId}/managedDevices
    GET /deviceManagement/detectedApps/{detectedAppId}/managedDevices/{managedDeviceId}/users/{userId}/managedDevices
    

    For more information, please refer https://video2.skills-academy.com/en-us/graph/api/intune-devices-manageddevice-list?view=graph-rest-1.0

    Hope this helps. Do let us know if you any further queries.

    Thanks,

    Akhilesh.


    If this answers your query, do click Accept Answer and Yes for was this answer helpful. And, if you have any further query do let us know.