Create a new Microsoft Teams project using Microsoft Teams Toolkit
發行項
You can create Teams apps in Visual Studio using the app templates. You can search and select any of the following Teams template to create a new app.
Bot
Tab
Message Extension
Prerequisites
Install
For using...
Visual Studio latest version
Install the latest enterprise edition of Visual Studio, and select the ASP.NET and web development workload and Microsoft Teams Development Tools for installation.
Teams Toolkit
A Visual Studio workload that creates a project scaffolding for your app. Use the latest version.
Access to Microsoft 365 account with the appropriate permissions to install an app.
Create a new Teams app
To create a new Teams app, follow the steps:
Open Visual Studio.
Create a new app by using one of the following two options:
Select New project under Quick actions to select a project template.
Select File > New > Project.
The Create a new project window appears.
Enter Teams in the search box and from search results, select Microsoft Teams App.
Select Next.
The Configure your new project window appears.
Enter a suitable name for your project.
注意
The project name you enter is updated in the Solution name field. You can change the solution name with no effect on the project name.
You can select the Place solution and project in the same directory checkbox to save the project and solution in the same folder.
Select the folder location where you want to create the project workspace.
Select Create.
The Create a new Teams application window appears.
Ensure Tab is selected, then select Create.
You can select any type of Teams app for your project.
注意
If you want to add single sign-on (SSO) capability to your Teams app, select the Configure with single sign-on checkbox. For more information, see how to add single sign-on to your Teams apps.
The GettingStarted .txt tab appears. You can see the instructions in GettingStarted window and check out the different features in Teams Toolkit.
You have created the app project scaffolding for your Teams app using Teams Toolkit template.
The steps to create the other apps are similar except notification bot.
Directory Structure
Teams Toolkit provides all components for building an app. After you're created the project, you can view the project folders and files under Solution Explorer.
Directory structure for a basic Teams app
Directory structure for a scenario-based Teams app
Teams app templates in Teams Toolkit
You can see Teams app templates already populated in Teams Toolkit for various Teams app types. The following table lists all the templates available:
Teams app templates
Description
Notification Bot
You can use the notification bot app to send notifications to your Teams client. There are multiple ways to trigger the notification. For example, trigger the notification by HTTP request, or by time. You can select triggered notification based on your business scenario.
Command Bot
You can type a command to interact with the bot using the command bot app.
Workflow Bot
You can interact with the bot using automate repetitive workflow action.
Tab
Tab app shows a webpage inside Teams, and it enables SSO using Teams account.
Message Extension
The message extension app implements simple features such as creating an Adaptive Card, searching NuGet packages, or unfurling links for the dev.botframework.com domain.
Teams 工具組是 Visual Studio Code 和 Visual Studio 2022 的延伸模組。 它可協助開發人員使用整合式身分識別、雲端記憶體和其他服務,跨 Microsoft 365 和 Azure 來建立和部署 Teams 應用程式。 在此學習路徑中,您將瞭解如何使用適用於 Visual Studio Code 的 Teams 工具組來建置 Microsoft Teams 應用程式。
Learn about build environments such as C# and Blazor of Teams Toolkit in Visual Studio to integrate Azure capabilities and cloud services for building apps.
Learn about Teams Toolkit UI in Visual Studio, and functions such as app dependencies, manifest update, and authentication code to build and develop your app.
Learn how to create basic and scenario-based Teams app in Visual Studio Code, its directory structure, and Teams app template available in Teams Toolkit.
Learn how to deploy Teams app to cloud resources such as Azure or SharePoint using Teams Toolkit in Visual Studio, and to customize and edit deploy section.