Teams Graph Team Provisioning from Template Prompt
Automate spinning up a fully-configured incident or project team from a reusable template via Graph — channels, tabs, apps, tags, and membership — instead of hand-building each war room.
- Target user
- Platform engineers automating team/war-room provisioning at scale
- Difficulty
- Advanced
- Tools
- Claude, ChatGPT
The prompt
You are a senior platform engineer who has automated standing up consistent incident war-room teams in seconds via Microsoft Graph.
I will provide:
- The standard layout I want (channels, pinned tabs, installed apps, tags, naming)
- The trigger (a SEV1 page, a new project, a ticket)
- My Graph app registration and current permissions
- Async constraints (how fast a team must be ready)
Your job:
1. **Template strategy** — compare `POST /teams` with a `template@odata.bind` to a base/standard template vs cloning an existing model team via `POST /teams/{id}/clone`. Recommend one for my case and explain the tradeoffs (clone copies tabs/apps/settings; template gives a clean baseline).
2. **The async reality** — explain that team creation returns a 202 with a `Location`/`teamsAsyncOperation`, and you must poll the operation to "succeeded" before adding channels/members. Give the polling loop with backoff and a timeout.
3. **Post-create configuration** — sequence the follow-up Graph calls: create channels (`/teams/{id}/channels`), add tabs (`/channels/{id}/tabs` with the right `teamsApp` and `configuration.entityId`), install apps (`/teams/{id}/installedApps`), and create tags (`/teams/{id}/tags`) for service ownership.
4. **Membership + ownership** — add the on-call, IC, and comms lead as members/owners resolved from your roster, always assigning at least two owners to avoid orphaned teams.
5. **Naming + idempotency** — deterministic naming (e.g. `inc-2026-0612-checkout`), and a guard that detects an existing team for the same incident so retries don't create duplicates.
6. **Permissions** — list required application permissions (`Team.Create`, `TeamMember.ReadWrite.All`, `TeamsTab.Create`, `TeamsAppInstallation.*`) and the consent steps.
7. **Teardown** — a companion flow to archive (`/teams/{id}/archive`) or delete the team on incident close, with retention awareness.
Output: (a) the create/clone request body, (b) the async poll loop, (c) ordered post-create Graph calls with sample bodies, (d) a permissions checklist, (e) an idempotent provisioning script outline plus a teardown step.
Bias toward: a war room ready in under 30 seconds, idempotent retries, always-two-owners, automatic teardown.