| name | generate-sdk-kiota |
| description | USE FOR: Generate or update a minimal, deterministic Microsoft Graph SDK with Kiota from resolved endpoints. Install, check version, generate or update SDK, check generated models.
DO NOT USE FOR: AI-generated SDK clients.
INVOKES: None.
|
Generate API client code
Generate client code with Kiota. Docs: Kiota usage.
Verify Kiota is installed:
kiota --version
If missing, install as a global .NET tool:
dotnet tool install --global Microsoft.OpenApi.Kiota
Make sure that it is up to the latest version:
dotnet tool update --global Microsoft.OpenApi.Kiota
API endpoints in Kiota
- Use glob paths; always replace id placeholders (ex.
/{id}/) with /*/.
- Always prefer exact endpoints with
--include-path <path>.
- Use
--include-path <path>/** only when all descendants are explicitly required.
Existing Project
If kiota-lock.json exists, read includePatterns, add new endpoints, then update from the project directory:
kiota update --output <client path>
If migrating from the complete Microsoft Graph SDK package (ex. Microsoft.Graph):
- Identify which Graph endpoints the existing code calls.
- Remove the full SDK package.
- Use
kiota generate for the same paths.
New Project
Generate with one --include-path per endpoint. For later changes, prefer kiota update over full regeneration.
kiota generate --language <csharp|python|typescript|java|go|php> --openapi "https://aka.ms/msgraph/dev-skills/openapi-<v1/beta>" --include-path <path> --include-path <path> --output ./GraphClient --class-name GraphServiceClient --namespace-name MyApp.GraphClient
Get required dependencies with:
kiota info -d "https://aka.ms/msgraph/dev-skills/openapi-<v1/beta>" -l <language>
Check Generated Models
Ensure the endpoints were generated by checking kiota-lock.json; avoid reading file contents unless required.
Common failure: endpoints with trailing parentheses (ex. /me/calendarView/delta()).