GraphBot is a Teams bot sample that calls Microsoft Graph with app credentials (client credentials flow), not user OAuth.
help- Shows available commandsorg- Reads tenant organization info from Graphusers- Lists top users from Graph
Use the same Entra app registration as your bot (AzureAd:ClientId) and configure:
- Client secret
- Entra ID -> App registrations -> your app -> Certificates & secrets -> New client secret
- Graph application permissions
Organization.Read.All(fororg)User.Read.All(forusers)
- Admin consent
- Entra ID -> App registrations -> your app -> API permissions -> Grant admin consent for <tenant>
Without admin consent, app-only Graph calls fail with "Insufficient privileges to complete the operation."
dotnet run --project .\samples\GraphBot\GraphBot.csprojThen message the bot in Teams with help, org, and users.