Describe the bug
I am trying to deploy my Teams app to Azure, and when I go to "Provision in Cloud...", it never asks for my environment and instead fails while trying to process the dev environment, when we have created a prod environment. We have looked for documentation on this subject and how environments get selected, but we can find none.
Our project was originally created as a "Teams Toolkit project, and this extension has been updated to the Microsoft 365 Agent Toolkit, which has worked for local development.
We are using the latest version of Visual Studio 2026 (not Code).
I have included the list of related files and a Copilot assessment of these files under additional context below.
To Reproduce
Steps to reproduce the behavior:
- Go to '...'
- Click on '....'
- Scroll down to '....'
- See error
Expected behavior
We expect to be able to select an environment or have another mechanism for selecting an environment through configuration for the various toolkit operations.
Screenshots
If applicable, add screenshots to help explain your problem.
VS Extension Information (please complete the following information):
- OS: Windows 11
- Version 18.3.3.25837
CLI Information (please complete the following information):
- OS: [e.g. iOS8.1]
- Version [e.g. 22]
Additional context
Microsoft 365 Agents Toolkit — prod Environment Not Appearing
Summary
After creating a prod environment following the standard Teams Toolkit convention (.env.prod in the environmentFolderPath), the Microsoft 365 Agents Toolkit in Visual Studio 2026 does not prompt or allow selection of the prod environment when running Provision or Deploy. Only dev and local are available. The solution has been fully closed and reopened.
Environment
| Item |
Value |
| IDE |
Visual Studio Professional 2026 (18.4.0) |
| Project Type |
Blazor (.NET 10) Teams Tab App with TeamsFx ProjectCapability |
| Pipeline Schema |
teamsapp.yml v1.1.0 (https://aka.ms/teams-toolkit/1.1.0/yaml.schema.json) |
| OS |
Windows |
File Layout
PI.App.GrowthHub/
├── teamsapp.yml (v1.1.0, environmentFolderPath: ./env)
├── teamsapp.local.yml (v1.1.0, local debug only)
├── PI.App.GrowthHub.csproj (ProjectCapability: TeamsFx)
└── env/
├── .env.local (TEAMSFX_ENV=local) ← Detected ✅
├── .env.local.user
├── .env.dev (TEAMSFX_ENV=dev) ← Detected ✅
├── .env.dev.user
├── .env.prod (TEAMSFX_ENV=prod) ← NOT Detected ❌
└── .env.prod.user
File Timestamps (all on disk, verified)
| File |
Size |
Last Modified |
.env.dev |
1026 B |
3/18/2026 1:08 PM |
.env.dev.user |
308 B |
3/18/2026 1:08 PM |
.env.local |
1009 B |
12/28/2025 10:39 AM |
.env.prod |
724 B |
3/18/2026 12:26 PM |
.env.prod.user |
288 B |
3/18/2026 12:42 PM |
teamsapp.yml |
6106 B |
3/18/2026 12:29 PM |
teamsapp.local.yml |
6191 B |
10/25/2025 9:48 PM |
Key Configuration
teamsapp.yml (lines 1–6)
# yaml-language-server: $schema=https://aka.ms/teams-toolkit/1.1.0/yaml.schema.json
version: 1.1.0
environmentFolderPath: ./env
.env.prod (line 2)
.csproj — TeamsFx Capability
<ProjectCapability Include="TeamsFx" />
.csproj — .env.*.user files included
<ItemGroup>
<None Include="env\.env.dev.user" />
<None Include="env\.env.local.user" />
<None Include="env\.env.prod.user" />
</ItemGroup>
Note: The .env.prod and other non-.user env files are not explicitly listed as <None> items. It is unclear whether the toolkit discovers environments via filesystem scan of environmentFolderPath or via project item inclusion. local and dev work without explicit inclusion, so this may not be the cause.
What Was Tried
- ✅ Verified
.env.prod exists on disk at the correct path
- ✅ Verified
TEAMSFX_ENV=prod is on line 2
- ✅ Verified
environmentFolderPath: ./env in teamsapp.yml
- ✅ Verified
PI.App.GrowthHub is set as the startup project
- ✅ Fully closed and reopened the solution
- ❌
prod still does not appear as a selectable environment
Expected Behavior
The Agents Toolkit should discover all .env.* files in the environmentFolderPath directory and present them as selectable environments (excluding local, which uses teamsapp.local.yml). The prod environment should appear alongside dev when running Provision or Deploy.
Actual Behavior
Only dev and local are available. The prod environment is not listed or prompted.
Possible Causes
- The toolkit may cache discovered environments and require a full VS restart (not just solution reload) — already tried.
- The
.env.local.user file has a TEAMSFX_M365_USER_NAME entry that .env.prod.user lacks — possibly triggers special handling.
- The toolkit may only discover environments that have been provisioned at least once (i.e., have populated
AAD_APP_CLIENT_ID, TEAMS_APP_ID, etc.). The prod env file has all generated values empty.
- A VS 2026 18.4.0 regression in environment discovery for the Microsoft 365 Agents Toolkit.
Describe the bug
I am trying to deploy my Teams app to Azure, and when I go to "Provision in Cloud...", it never asks for my environment and instead fails while trying to process the dev environment, when we have created a prod environment. We have looked for documentation on this subject and how environments get selected, but we can find none.
Our project was originally created as a "Teams Toolkit project, and this extension has been updated to the Microsoft 365 Agent Toolkit, which has worked for local development.
We are using the latest version of Visual Studio 2026 (not Code).
I have included the list of related files and a Copilot assessment of these files under additional context below.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
We expect to be able to select an environment or have another mechanism for selecting an environment through configuration for the various toolkit operations.
Screenshots
If applicable, add screenshots to help explain your problem.
VS Extension Information (please complete the following information):
CLI Information (please complete the following information):
Additional context
Microsoft 365 Agents Toolkit —
prodEnvironment Not AppearingSummary
After creating a
prodenvironment following the standard Teams Toolkit convention (.env.prodin theenvironmentFolderPath), the Microsoft 365 Agents Toolkit in Visual Studio 2026 does not prompt or allow selection of theprodenvironment when running Provision or Deploy. Onlydevandlocalare available. The solution has been fully closed and reopened.Environment
TeamsFxProjectCapabilityteamsapp.ymlv1.1.0 (https://aka.ms/teams-toolkit/1.1.0/yaml.schema.json)File Layout
File Timestamps (all on disk, verified)
.env.dev.env.dev.user.env.local.env.prod.env.prod.userteamsapp.ymlteamsapp.local.ymlKey Configuration
teamsapp.yml(lines 1–6).env.prod(line 2).csproj— TeamsFx Capability.csproj—.env.*.userfiles includedWhat Was Tried
.env.prodexists on disk at the correct pathTEAMSFX_ENV=prodis on line 2environmentFolderPath: ./envinteamsapp.ymlPI.App.GrowthHubis set as the startup projectprodstill does not appear as a selectable environmentExpected Behavior
The Agents Toolkit should discover all
.env.*files in theenvironmentFolderPathdirectory and present them as selectable environments (excludinglocal, which usesteamsapp.local.yml). Theprodenvironment should appear alongsidedevwhen running Provision or Deploy.Actual Behavior
Only
devandlocalare available. Theprodenvironment is not listed or prompted.Possible Causes
.env.local.userfile has aTEAMSFX_M365_USER_NAMEentry that.env.prod.userlacks — possibly triggers special handling.AAD_APP_CLIENT_ID,TEAMS_APP_ID, etc.). Theprodenv file has all generated values empty.