Posted in

Generate a Light, Custom Microsoft Graph SDK With Kiota

πŸ”Ή Feature: Generate a Lean, Custom Microsoft Graph SDK With Kiota
πŸ”Ή What wIt Does: Generates a minimal Microsoft Graph client library containing only the paths your app actually uses β€” dramatically smaller install footprint than the full Microsoft-published SDK.

What Is It Giving You:

βœ… Massive Size Reduction vs the Full SDK: The official Microsoft Graph SDK covers the entire Graph surface, but most apps only use a small slice (mail, calendar, Teams, To Do, Planner, SharePoint files). Kiota builds a client that includes just the slices you need. Perfect for mobile apps, edge functions, containers, or any environment where install size matters.
βœ… Same Conventions, Same Fluent Syntax: Kiota-generated clients follow the same patterns as the Microsoft-published SDK. Calls like graphClient.Me.Todo.Lists.GetAsync() feel completely familiar. Your team won’t need to learn a new API style.
βœ… Scope With –include-path / –exclude-path: Use URL prefixes at generation time to define your slice. Example:
kiota generate –openapi https://aka.ms/graph/v1.0/openapi.yaml –include-path /me/todo/** –language CSharp
creates a To Do–only client. Same pattern works for /me/messages/**, /teams/**, /sites/**, or any subset.
βœ… Interops With Microsoft Graph Core Library: Add Microsoft.Graph.Core (or language equivalent) for cross-cutting features like PageIterator, batch requests, and large file uploads. You get the small footprint and the ecosystem helpers.
βœ… Works Against v1.0 or Beta: Feed Kiota the official OpenAPI descriptions β€” https://aka.ms/graph/v1.0/openapi.yaml for GA or https://aka.ms/graph/beta/openapi.yaml for beta. Regenerate to pick up new API surface as needed.
βœ… Ten Languages, Same Tool: C#, Java, Go, Python, TypeScript, PHP, Ruby, Swift, Dart, plus CLI. One generator, consistent patterns across platforms β€” great for cross-language teams.
βœ… Not Just for Microsoft Graph: Kiota works with any OpenAPI-described API β€” internal REST APIs, Azure Management APIs, or third-party services.
βœ… Full-Fidelity Auth Story: Uses Azure.Identity credentials (DeviceCode, ManagedIdentity, DefaultAzureCredential, ClientSecret, etc.) via AzureIdentityAuthenticationProvider, with an allowedHosts allowlist to only send tokens to Graph.

πŸ”Έ Kiota output is source files in your repo β€” slightly larger repo, but negligible versus removing the full SDK.
πŸ”Έ New Graph APIs require regeneration to include the new models and request builders β€” plan for it in CI/CD.

🌐 https://learn.microsoft.com/en-us/graph/sdks/generate-with-kiota
🌐 Kiota overview: https://learn.microsoft.com/en-us/openapi/kiota/overview

Microsoft Certified Trainer, Office 365, AWS, Azure and Cloud Expert-Architect. In the IT world for over than 20 years.

Apart from the main area of Microsoft Azure expert in the field of infrastructure servers Windows Server 2003-2019, Microsoft Active Directory, Hyper-V Private Cloud, IIS, System Center, SQL.

Private Cloud, System Center, Hyper-V, Open Stack Expert and all Microsoft products Expert. Linux Server administrator.

My Azure community projects:

https://mazeball.azurewebsites.net/
https://github.com/MariuszFerdyn?tab=repositories

More