Skip to content
Scalekit Docs
Talk to an Engineer Dashboard

Connect AI agents to Microsoft Entra ID

Scalekit connector
Open markdown

The Microsoft Entra ID connector lets your AI agent act in each user's Microsoft Entra ID account. Each user signs in to Microsoft Entra ID once, and Scalekit stores and refreshes their tokens, so your agent never handles credentials. It comes with 82 tools.

Tools
82
What they doRead · write · destructive
61 · 20 · 161 read20 write1 destructive
Users sign in with
OAuth app
Your own Microsoft Entra ID app

Setup

  1. Install the SDK

    Terminal window
    npm install @scalekit-sdk/node dotenv
  2. Set your credentials

    Add your Scalekit credentials to your .env file. Find values in app.scalekit.com > Developers > API Credentials.

    .env
    SCALEKIT_ENVIRONMENT_URL=<your-environment-url>
    SCALEKIT_CLIENT_ID=<your-client-id>
    SCALEKIT_CLIENT_SECRET=<your-client-secret>
  3. Create the Microsoft Entra ID connection

    In AgentKit > Connections, create a Microsoft Entra ID connection and copy its redirect URI. The name you give it is the connection_name your code passes. See Configure connections.

  4. Register an OAuth app

    Microsoft Entra ID connections use your own OAuth app. Register one with Microsoft Entra ID and add the redirect URI you copied.

    Then enter the app's Client ID and Client Secret on the Microsoft Entra ID connection.

  5. Authorize a user and make your first call

    quickstart.mts
    import { ScalekitClient } from '@scalekit-sdk/node'
    import 'dotenv/config'
    import { createInterface } from 'node:readline/promises'
    const scalekit = new ScalekitClient(
    process.env.SCALEKIT_ENVIRONMENT_URL,
    process.env.SCALEKIT_CLIENT_ID,
    process.env.SCALEKIT_CLIENT_SECRET,
    )
    const actions = scalekit.actions
    const connector = 'microsoftentraid'
    const identifier = 'user_123'
    // Generate an authorization link for the user
    const { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })
    console.log('Authorize Microsoft Entra ID:', link)
    const rl = createInterface({ input: process.stdin, output: process.stdout })
    await rl.question('Press Enter after authorizing...')
    rl.close()
    // Make your first call
    const result = await actions.executeTool({
    connector,
    identifier,
    toolName: 'microsoftentraid_administrative_units_list',
    toolInput: {},
    })
    console.log(result)
    Terminal window
    npx tsx quickstart.mts

    Each user signs in once. See Authorize a user for the full flow and statuses.

Tools

Pass the exact name to execute_tool
Try in PlaygroundRequest a tool
  • microsoftentraid_administrative_unit_members_listList the users, groups and devices that belong to an administrative unit.Read-only

    List Administrative Unit Members

    List the users, groups and devices that belong to an administrative unit. Returns directory objects with @odata.type, id and displayName. Use administrative_unit_members_list to see who a scoped admin can manage. Use administrative_units_list to find the unit ID.

    Inputs

    administrative_unit_idstringrequired
    Object ID (GUID) of the administrative unit.
    $skiptokenstring
    Opaque paging token. To fetch the next page, copy the value of the $skiptoken query parameter from the @odata.nextLink URL of the previous response.
    $topinteger
    Maximum number of results per page (1 to 999). When more results exist the response includes @odata.nextLink.
  • microsoftentraid_administrative_units_listList the administrative units that scope delegated administration in the tenant.Read-only

    List Administrative Units

    List the administrative units that scope delegated administration in the tenant. Returns administrativeUnit objects (id, displayName, description, visibility, membershipType). Use administrative_units_list to find units for scoped role assignments. Use administrative_unit_members_list for the members of one.

    Inputs

    $filterstring
    OData $filter expression to narrow administrative units. Example: startswith(displayName,'EMEA'). Properties other than a few basics need advanced query support, which this tool enables by sending ConsistencyLevel: eventual.
    $skiptokenstring
    Opaque paging token. To fetch the next page, copy the value of the $skiptoken query parameter from the @odata.nextLink URL of the previous response.
    $topinteger
    Maximum number of results per page (1 to 999). When more results exist the response includes @odata.nextLink.
  • microsoftentraid_application_federated_credentials_listList the federated identity credentials of an application registration (workload identity federation).Read-only

    List Application Federated Credentials

    List the federated identity credentials of an application registration (workload identity federation). Returns federatedIdentityCredential objects (id, name, issuer, subject, audiences). Use application_federated_credentials_list to audit trusted external identity providers such as GitHub Actions. Use application_federated_credential_create to add one.

    Inputs

    application_idstringrequired
    Object ID (GUID) of the application registration. This is the 'id' property, not the appId (client ID).
    $skiptokenstring
    Opaque paging token. To fetch the next page, copy the value of the $skiptoken query parameter from the @odata.nextLink URL of the previous response.
    $topinteger
    Maximum number of results per page (1 to 999). When more results exist the response includes @odata.nextLink.
  • microsoftentraid_application_getGet one application registration by object ID.Read-only

    Get Application

    Get one application registration by object ID. Returns the application's properties such as appId, displayName, signInAudience, web redirect URIs, requiredResourceAccess, keyCredentials and passwordCredentials metadata. Use application_get for a known app registration. Use applications_list to find it first.

    Inputs

    application_idstringrequired
    Object ID (GUID) of the application registration. This is the 'id' property, not the appId (client ID).
    $selectstring
    Comma-separated list of application properties to return. Example: id,appId,displayName,signInAudience,createdDateTime,web,requiredResourceAccess,passwordCredentials,keyCredentials. Graph returns only a default subset of properties unless you list the ones you need here.
  • microsoftentraid_application_owners_listList the owners of an application registration.Read-only

    List Application Owners

    List the owners of an application registration. Returns directory objects (users or service principals) with id, displayName and userPrincipalName. Use application_owners_list to find who manages an app registration. Use application_owner_add to add one.

    Inputs

    application_idstringrequired
    Object ID (GUID) of the application registration. This is the 'id' property, not the appId (client ID).
    $countboolean
    Set to true to include the total number of matching objects as @odata.count in the response. Required when a $filter or $orderby uses advanced query operators such as ne, not, endsWith or a $count-based filter.
    $selectstring
    Comma-separated list of owner properties to return. Example: id,displayName,userPrincipalName,mail. Graph returns only a default subset of properties unless you list the ones you need here.
    $skiptokenstring
    Opaque paging token. To fetch the next page, copy the value of the $skiptoken query parameter from the @odata.nextLink URL of the previous response.
    $topinteger
    Maximum number of results per page (1 to 999). When more results exist the response includes @odata.nextLink.
  • microsoftentraid_applications_listList application registrations in the Microsoft Entra tenant.Read-only

    List Applications

    List application registrations in the Microsoft Entra tenant. Returns application objects (id, appId, displayName, signInAudience, createdDateTime by default) plus @odata.nextLink when more pages exist. Use applications_list to find app registrations. Use service_principals_list for the enterprise application (tenant instance) of an app.

    Inputs

    $countboolean
    Set to true to include the total number of matching objects as @odata.count in the response. Required when a $filter or $orderby uses advanced query operators such as ne, not, endsWith or a $count-based filter.
    $filterstring
    OData $filter expression to narrow applications. Example: displayName eq 'Payroll Portal'. Properties other than a few basics need advanced query support, which this tool enables by sending ConsistencyLevel: eventual.
    $orderbystring
    OData $orderby expression to sort results. Example: displayName. Sorting combined with a filter may need advanced query support.
    $searchstring
    Free-text search over applications, written as "property:term" with the double quotes included. Example: "displayName:Payroll". Requires advanced query support, which this tool enables by sending ConsistencyLevel: eventual.
    $selectstring
    Comma-separated list of application properties to return. Example: id,appId,displayName,signInAudience,createdDateTime. Graph returns only a default subset of properties unless you list the ones you need here.
    $skiptokenstring
    Opaque paging token. To fetch the next page, copy the value of the $skiptoken query parameter from the @odata.nextLink URL of the previous response.
    $topinteger
    Maximum number of results per page (1 to 999). When more results exist the response includes @odata.nextLink.
  • microsoftentraid_authentication_strength_policies_listList the authentication strength policies (built-in and custom) that Conditional Access can require.Read-only

    List Authentication Strength Policies

    List the authentication strength policies (built-in and custom) that Conditional Access can require. Returns authenticationStrengthPolicy objects (id, displayName, policyType, allowedCombinations). Use authentication_strength_policies_list to see which MFA method combinations satisfy each strength. Needs the Policy.Read.All scope.

    Inputs

    $filterstring
    OData $filter expression to narrow authentication strength policies. Example: policyType eq 'custom'. Properties other than a few basics need advanced query support, which this tool enables by sending ConsistencyLevel: eventual.
  • microsoftentraid_conditional_access_policies_listList the Conditional Access policies of the tenant.Read-only

    List Conditional Access Policies

    List the Conditional Access policies of the tenant. Returns conditionalAccessPolicy objects (id, displayName, state, conditions, grantControls, sessionControls). Use conditional_access_policies_list to audit access rules. Use conditional_access_policy_get for one policy. Needs the Policy.Read.All scope.

    Inputs

    $filterstring
    OData $filter expression to narrow policies. Example: state eq 'enabled'. Properties other than a few basics need advanced query support, which this tool enables by sending ConsistencyLevel: eventual.