OfficeDev / teams-toolkit

Developer tools for building Teams apps
Other
459 stars 188 forks source link

Task: Provision only works with "local" env. #12516

Open stokedout opened 2 weeks ago

stokedout commented 2 weeks ago

Describe the bug

I can't choose any other env other than local when working with different launch/task profiles. Is it hardcoded to use local or something?

To Reproduce Steps to reproduce the behavior: To support another environment I created for a client named xyz:

envs/env.xyz set > TEAMSFX_ENV=xyz envs/env.xyz.user teamsapp.xyz.yml tasks.json >

...
    {
      // Check all required prerequisites.
      // See https://aka.ms/teamsfx-tasks/check-prerequisites to know the details and how to customize the args.
      "label": "xyz: Validate prerequisites",
      "type": "teamsfx",
      "command": "debug-check-prerequisites",
      "args": {
        "prerequisites": [
          "m365Account" // Sign-in prompt for Microsoft 365 account, then validate if the account enables the sideloading permission.
        ]
      }
    },
    {
      // Create the debug resources.
      // See https://aka.ms/teamsfx-tasks/provision to know the details and how to customize the args.
      "label": "xyz: Provision",
      "type": "teamsfx",
      "command": "provision",
      "args": {
        "env": "xyz"
      }
    },
    {
      // Build project.
      // See https://aka.ms/teamsfx-tasks/deploy to know the details and how to customize the args.
      "label": "xyz: Deploy",
      "type": "teamsfx",
      "command": "deploy",
      "args": {
        "env": "xyz"
      }
    }
...

Run the debug profile

Expected behavior Picks up the env I choose

Screenshots

image

VS Code Extension Information (please complete the following information):

CLI Information (please complete the following information):

Additional context Output:

[2024-10-14T10:47:59.060Z] [Info] - Running 'Validate prerequisites' Visual Studio Code task.

(Total: 1 Step) Teams Toolkit is checking the required prerequisites.

(1/1) Checking Microsoft 365 Account ...

Summary:

(√) Done: Microsoft 365 Account (xxx@xxxx.com) is logged in and custom app upload permission is enabled 

Visit https://aka.ms/teamsfx-tasks/check-prerequisites to learn more about 'Validate prerequisites' task.

[2024-10-14T10:47:59.720Z] [Info] - Finished 'Validate prerequisites' Visual Studio Code task in 0.66 seconds.
[2024-10-14T10:47:59.802Z] [Error] - code:Coordinator.LifeCycleUndefinedError, message: Lifecycle 'provision' is undefined, yaml file: /Users/stoker/src/qluent-ui/teamsapp.yml
 Help link: https://aka.ms/teamsfx-actions
microsoft-github-policy-service[bot] commented 2 weeks ago

Thank you for contacting us! Any issue or feedback from you is quite important to us. We will do our best to fully respond to your issue as soon as possible. Sometimes additional investigations may be needed, we will usually get back to you within 2 days by adding comments to this issue. Please stay tuned.

lijie-lee commented 1 week ago

Hi @stokedout,

Currently, TTK support "Provision" with self-defined env. There is a official flow that could help you to make it. Please check this wiki: Create a new environment manually in Visual Studio Code