BlogInfrastructure

LiteLLM with Microsoft Entra ID

Connecting LiteLLM to Entra ID takes an app registration, a redirect URI and three settings. After that people sign in to the gateway with their company account, Entra groups become LiteLLM teams, and app roles decide who is an admin. Two things deserve attention before you call it done: single sign-on for more than five users needs the Enterprise licence, and group changes only arrive in LiteLLM when a person signs in again. As of 27 November 2026.

By Updated

What single sign-on covers

Single sign-on is for people signing in to the gateway's interface, where they see their spend and create keys. It does not change how applications call the gateway. Those still send a virtual key with every request. It is easy to expect the second from the first.

In the open-source version single sign-on is free for up to five users. Beyond that it needs the Enterprise licence, which also brings SCIM provisioning and sign-in for API calls with tokens from your identity provider.

Setting it up

  1. 1

    Register an application in Entra ID

    Create an app registration for the gateway and a client secret. Note the client ID and the tenant ID.

  2. 2

    Set the redirect URI

    It is the address of your gateway followed by /sso/callback. Use the hostname people will really use, with HTTPS.

  3. 3

    Give the gateway the three values

    Client ID, client secret and tenant go into the gateway's environment. The secret belongs in your secret manager.

  4. 4

    Assign groups to the enterprise application

    Only groups assigned to the application are read at sign-in. Start with the pilot teams and no more.

The settings LiteLLM reads for Microsoft sign-in, as named in its documentation
MICROSOFT_CLIENT_ID="<client id>"
MICROSOFT_CLIENT_SECRET="<client secret>"
MICROSOFT_TENANT="<tenant id>"

# redirect URI to register in Entra ID
https://llm-gateway.example.com/sso/callback

Groups become teams

When someone signs in, LiteLLM reads the groups assigned to the application. For a group it does not know yet, it creates a team with the group's name and the same ID. The person is added to the teams that match their groups. Your directory stays the place where membership is decided.

A team created this way has no budget and no model list unless you set defaults. Do that before the first sign-in, otherwise the first team starts without limits.

Defaults for teams that LiteLLM creates at sign-in, with the field names from its documentation
litellm_settings:
  default_team_params:
    max_budget: 100
    budget_duration: 30d
    models: ["gpt-standard"]

Roles from Entra ID

Who is an admin can also come from the directory. You create app roles in the app registration and assign people to them. LiteLLM reads the role from the sign-in token and stores it. If a person has several roles, the highest one counts.

Role values LiteLLM accepts from Entra ID, from the LiteLLM Microsoft SSO tutorial, checked on 27 November 2026
Role valueWho should get it
proxy_adminThe two or three people who run the gateway
proxy_admin_viewerPeople who need to see everything and change nothing, such as finance or audit
internal_userEveryone who creates their own keys
internal_user_viewerPeople who should only look at their own usage

The role of an organisation admin cannot be granted this way. LiteLLM's tutorial says it has to be assigned per organisation inside LiteLLM.

Offboarding needs its own test

Group and team membership is synchronised when a person signs in. The tutorial does not say what happens to someone who is removed from a group and never signs in again, or to the keys they created. That is exactly the case security will ask about, so test it before go-live.

  • Remove a test user from a group in Entra ID and check whether their key still works an hour later
  • Disable the test user completely and check again
  • If keys outlive the account, give personal keys a short lifetime, and look at SCIM provisioning, which LiteLLM supports for Entra ID with the Enterprise licence
  • Write the result into the handover document, so the next admin does not have to find out again

Connecting the identity provider and testing these cases is part of our gateway setup work.

Questions

Does LiteLLM support Microsoft Entra ID?

Yes. It supports sign-in with Entra ID, creates teams from assigned groups and reads roles from app roles. SCIM provisioning for Entra ID is supported as well.

Do we need the Enterprise licence for Entra ID sign-in?

For up to five users, no. For more than five users, yes.

When does a change in an Entra group reach LiteLLM?

At the person's next sign-in to the gateway. Until then LiteLLM works with what it stored at the last sign-in.

Talk to an engineer

Bring one piece of work you would like to improve. The call takes 30 minutes and needs no access to your systems or your data.

Booking runs on Google Calendar.

Mickey Graf

Mickey Graf

Founder and CEO of Cloudsail

Rated 4.9 out of 5 on Clutch

Prefer to write first? Leave your email and a few lines. Mickey reads every message himself and replies by email with times for a call.

The button prepares an email in your own email program, for you to send. Privacy policy (draft)