teams app create
Create a new Teams app with bot
Usage​
teams app create [options]
Options​
| Flag | Description |
|---|---|
-n, --name <name> | App/bot name |
-e, --endpoint <url> | [OPTIONAL] Bot messaging endpoint URL |
--env <path> | [OPTIONAL] Path to credentials file (.env or appsettings.json) |
--env-file <path> | [OPTIONAL] Alias for --env |
--no-secret | [OPTIONAL] Skip client secret generation (for managed identity or federated credentials) |
--azure | [OPTIONAL] Create bot in Azure (requires az CLI) |
--teams-managed | [OPTIONAL] Create bot managed by Teams (default) |
--subscription <id> | [OPTIONAL] Azure subscription ID (defaults to az CLI default) |
--resource-group <name> | Azure resource group (required for --azure) |
--create-resource-group | [OPTIONAL] Create the resource group if it doesn't exist |
--region <name> | [OPTIONAL] Azure region for resource group (default: westus2) |
--color-icon <path> | [OPTIONAL] Path to color icon (192x192 PNG) |
--outline-icon <path> | [OPTIONAL] Path to outline icon (32x32 PNG) |
--json | [OPTIONAL] Output as JSON |
Details​
Creates a complete Teams bot app in a single command: AAD app registration, client secret, manifest, Teams app import, and bot registration.
Bot Location​
By default, the bot is Teams-managed (no Azure subscription needed). Use --azure to create an Azure Bot instead, which is required for OAuth and SSO features.
Precedence: --azure/--teams-managed flag > teams config set default-bot-location > Teams-managed default.
See Bot Locations for details on the trade-offs.
Scopes​
During interactive creation, you can customize which scopes the bot supports:
| Scope | Description |
|---|---|
| Personal | 1:1 chat with the bot (default) |
| Team | Channel conversations (default) |
| Group Chat | Group chat conversations (default) |
| Copilot | Available as a custom engine agent in M365 Copilot |
Selecting Copilot automatically adds the copilotAgents.customEngineAgents block to the manifest and ensures the Personal scope is included (required by M365 Copilot).
Examples​
Create with defaults (Teams-managed, generated manifest):
teams app create --name "My Bot"
Create with Azure bot and write credentials to .env:
teams app create --name "My Bot" --azure --subscription <id> --resource-group my-rg --env .env
For C# projects, write credentials to appsettings.json instead:
teams app create --name "My Bot" --env appsettings.json
This writes credentials under a Teams section with PascalCase keys (ClientId, ClientSecret, TenantId).
Skipping Secret Generation​
Use --no-secret to skip client secret generation when using managed identity or federated credentials:
teams app create --name "My Bot" --no-secret
Only CLIENT_ID and TENANT_ID are output. You can generate a secret later with teams app auth secret create.
Output​
On success, outputs:
CLIENT_ID=<app-client-id>
CLIENT_SECRET=<generated-secret>
TENANT_ID=<your-tenant-id>
Portal Equivalent​
In the Teams Developer Portal, this is equivalent to: Apps → New app, then separately configuring bot registration and generating credentials. The CLI does it all in one step.