Updates from: 04/27/2022 01:20:26
Service Microsoft Docs article Related commit history on GitHub Change details
platform Bot Features https://github.com/MicrosoftDocs/msteams-docs/commits/main/msteams-platform/bots/bot-features.md
this.onMessage(async (context, next) => {
## Code sample
-|Sample name | Description | .NETCore | Node.js |
-|-|--|--|-|
-| Teams conversation bot | Messaging and conversation event handling. |[View](https://github.com/microsoft/BotBuilder-Samples/tree/master/samples/csharp_dotnetcore/57.teams-conversation-bot)|[View](https://github.com/microsoft/BotBuilder-Samples/tree/master/samples/javascript_nodejs/57.teams-conversation-bot)|
-| Bot samples | Set of bot samples | [View](https://github.com/microsoft/BotBuilder-Samples/tree/main/samples/csharp_dotnetcore) | |
+|Sample name | Description | .NETCore | Node.js | Python|
+|-|--|--|-|-|
+| Teams conversation bot | Messaging and conversation event handling. |[View](https://github.com/microsoft/BotBuilder-Samples/tree/master/samples/csharp_dotnetcore/57.teams-conversation-bot)|[View](https://github.com/microsoft/BotBuilder-Samples/tree/master/samples/javascript_nodejs/57.teams-conversation-bot)|[View](https://github.com/microsoft/BotBuilder-Samples/tree/main/samples/python/57.teams-conversation-bot)|
+| Bot samples | Set of bot samples | [View](https://github.com/microsoft/BotBuilder-Samples/tree/main/samples/csharp_dotnetcore) |[View](https://github.com/microsoft/BotBuilder-Samples/tree/main/samples/javascript_nodejs)|[View](https://github.com/microsoft/BotBuilder-Samples/tree/main/samples/python)|
## Next step
platform Calls Meetings Bots Overview https://github.com/MicrosoftDocs/msteams-docs/commits/main/msteams-platform/bots/calls-and-meetings/calls-meetings-bots-overview.md
Real-time media refers to scenarios where media must be processed in real-time,
* [Requirements and considerations for application-hosted media bots](./requirements-considerations-application-hosted-media-bots.md) * [Technical information on handling incoming call notifications](./call-notifications.md) * [Set up an auto attendant](/microsoftteams/create-a-phone-system-auto-attendant)
-* [Set up auto answer for Microsoft Teams Rooms on Android and Teams video phone devices](/microsoftteams/set-up-auto-answer-on-teams-android)
+* [Set up auto answer for Microsoft Teams Rooms on Android and Teams video phone devices](/microsoftteams/set-up-auto-answer-on-teams-android)
+* [Teams recording policy](/MicrosoftTeams/teams-recording-policy)
platform Subscribe To Conversation Events https://github.com/MicrosoftDocs/msteams-docs/commits/main/msteams-platform/bots/how-to/conversations/subscribe-to-conversation-events.md
async def on_installation_update(self, turn_context: TurnContext):
## Uninstall behavior for personal app with bot
-> [!NOTE]
-> Uninstall behavior for personal app with bot is currently available only in [public developer preview](../../../resources/dev-preview/developer-preview-intro.md).
- When you uninstall an app, the bot is also uninstalled. When a user sends a message to your app, they receive a 403 response code. Your bot receives a 403 response code for new messages posted by your bot. The post uninstall behavior for bots in the personal scope with the Teams and groupChat scopes are now aligned. You cannot send or receive messages after an app has been uninstalled. + <img src="~/assets/images/bots/uninstallbot.png" alt="Uninstall event" width="900" height="900"/> ## Event handling for install and uninstall events
platform App Templates https://github.com/MicrosoftDocs/msteams-docs/commits/main/msteams-platform/samples/app-templates.md
To provide feedback, see [App template feedback](https://forms.office.com/Pages/
* [Designing your personal app for Microsoft Teams](../concepts/design/personal-apps.md) * [Design System](../concepts/design/design-teams-app-fundamentals.md) * [Transition conversations from bot to human](/azure/bot-service/bot-service-design-pattern-handoff-human)
+* [How to deploy Teams app templates](/microsoft-365/community/how-to-deploy-teams-app-templates)
platform Overview https://github.com/MicrosoftDocs/msteams-docs/commits/main/msteams-platform/task-modules-and-cards/cards/Universal-actions-for-adaptive-cards/Overview.md
The following image depicts the Universal Actions for Adaptive Cards for both Te
# [Desktop](#tab/desktop) * * *
The following image shows an example of a ticketing messaging extension (ME) whe
# [Mobile](#tab/mobile) # [Desktop](#tab/desktop) * * *
The following image illustrates a food ordering bot example: <br/>
The following image shows the various states for different users in the chat or channel: For more information, see [sample for Sequential Workflow](Sequential-Workflows.md).
For more information, see [sample for Sequential Workflow](Sequential-Workflows.
You can create Adaptive Cards that update automatically. For example, it can be an approval request sent by a user. After approval, the card must automatically display details about the request approval time and who approved the request. The refresh model enables you to provide such up to date views. The following image shows a multi-step approval flow and how the views for different users is shown. For more information, see [sample for up to date views](Up-To-Date-Views.md).
platform Sequential Workflows https://github.com/MicrosoftDocs/msteams-docs/commits/main/msteams-platform/task-modules-and-cards/cards/Universal-actions-for-adaptive-cards/Sequential-Workflows.md
The following image shows the Sequential Workflow:
A user can progress through their workflow without modifying the card for other users. The workflow is also useful for conducting quizzes using sequential Adaptive Cards. The following image shows different users can be at different stages of the workflow and states of the card: > [!NOTE] > In order to sync the user's progress across devices, use the `refresh` property in Adaptive Card JSON.
platform User Specific Views https://github.com/MicrosoftDocs/msteams-docs/commits/main/msteams-platform/task-modules-and-cards/cards/Universal-actions-for-adaptive-cards/User-Specific-Views.md
For example, Megan, a safety inspector at Contoso, wants to create an incident a
# [Mobile](#tab/mobile) # [Desktop](#tab/desktop) * * *
platform Cards Format https://github.com/MicrosoftDocs/msteams-docs/commits/main/msteams-platform/task-modules-and-cards/cards/cards-format.md
You can use the `\r` or `\n` escape sequences for newlines in lists. Using `\n\n
On the desktop, Adaptive Card Markdown formatting appears as shown in the following image in both web browsers and in the Teams client application:
-![Adaptive Card Markdown formatting in the desktop client](../../assets/images/cards/Adaptive-markdown-desktop-client.png)
On iOS, Adaptive Card Markdown formatting appears as shown in the following image:
-![Adaptive Card Markdown formatting in iOS](../../assets/images/cards/Adaptive-markdown-iOS-75.png)
On Android, Adaptive Card Markdown formatting appears as shown in the following image:
-![Adaptive Card Markdown formatting in Android](../../assets/images/cards/Adaptive-markdown-Android.png)
For more information, see [text features in Adaptive Cards](/adaptive-cards/create/textfeatures).
Adaptive Cards support emoji. The following code shows an example of Adaptive Ca
{ "$schema": "http://adaptivecards.io/schemas/adaptive-card.json", "type": "AdaptiveCard", "version": "1.0", "body": [ { "type": "Container", "items": [ { "type": "TextBlock", "text": "Publish Adaptive Card with emojis 🥰 ", "weight": "bolder", "size": "medium" }, ] }, ], } ``` ### Mention support within Adaptive Cards
Example for user mention in bots with Adaptive Cards as follows:
Following image illustrates the user mention with Adaptive Card in Bot:
-![User mention in bot with Adaptive Card](~/assets/images/authentication/user-mention-in-bot.png)
#### User mention in Incoming Webhook with Adaptive Cards
Example for user mention in Incoming Webhook as follows:
Following image illustrates user mention in Incoming Webhook:
-![User mention in Incoming Webhook](~/assets/images/authentication/user-mention-in-incoming-webhook.png)
### Information masking in Adaptive Cards
The following code shows an example of Adaptive Card with masking property:
The following image is an example of masking information in Adaptive Cards:
-![Masking information image](../../assets/images/cards/masking-information-view.png)
### Full width Adaptive Card
To make a full width Adaptive Card, your app must include the elements from the
The following image shows a full width Adaptive Card:
-![Full width Adaptive Card view](../../assets/images/cards/full-width-adaptive-card.png)
The following image shows the default view of the Adaptive Card when you have not set the `width` property to **Full**:
-![Small width Adaptive Card view](../../assets/images/cards/small-width-adaptive-card.png)
### Typeahead support
In an Adaptive Card, you can use the `msteams` property to add the ability to di
When users hover over the image, an expand icon appears at the top right corner as shown in the following image:
-![Adaptive Card with expandable image](../../assets/images/cards/adaptivecard-hover-expand-icon.png)
The image appears in stage view when the user selects the expand icon as shown in the following image:
-![Image expanded to stage view](../../assets/images/cards/adaptivecard-expand-image.png)
In the stage view, users can zoom in and zoom out of the image. You can select the images in your Adaptive Card that must have this capability.
In connector cards, newlines are rendered for `\n\n`, but not for `\n` or `\r`.
On the desktop, Markdown formatting for connector cards appears as shown in the following image:
-![Markdown formatting for connector cards in the Desktop client](../../assets/images/cards/connector-desktop-markdown-combined.png)
On iOS, Markdown formatting for connector cards appears as shown in the following image:
-![Markdown formatting for connector cards in the iOS client](../../assets/images/cards/connector-iphone-markdown-combined-80.png)
Connector cards using Markdown for iOS include the following issues:
Connector cards using Markdown for iOS include the following issues:
On Android, Markdown formatting for connector cards appears as shown in the following image:
-![Markdown formatting for connector cards in the Android client](../../assets/images/cards/connector-android-markdown-combined.png)
### Format example for Markdown connector cards
In connector cards, newlines are rendered in HTML using the `<p>` tag.
On the desktop, HTML formatting for connector cards appears as shown in the following image:
-![HTML formatting for connector cards in the desktop client](../../assets/images/cards/Connector-desktop-html-combined.png)
On iOS, HTML formatting appears as shown in the following image:
-![HTML formatting for connector cards in the iOS client](../../assets/images/cards/connector-iphone-html-combined-80.png)
Connector cards using HTML for iOS include the following issues:
Connector cards using HTML for iOS include the following issues:
On Android, HTML formatting appears as shown in the following image:
-![HTML formatting for connector cards in the Android client](../../assets/images/cards/connector-android-html-combined.png)
### Format sample for HTML connector cards
As there are resolution differences between the desktop and mobile platform, for
On the desktop, HTML formatting appears as shown in the following image:
-![HTML formatting in the desktop client](../../assets/images/cards/card-formatting-xml-desktop-v2.png)
On iOS, HTML formatting appears as shown in the following image:
-![HTML formatting in the iOS client](../../assets/images/cards/card-formatting-xml-mobile-v2.png)
Character formatting, such as bold and italic are not rendered on iOS. On Android, HTML formatting appears as shown in the following image:
-![HTML formatting in the Android client](../../assets/images/cards/card-formatting-xml-android-60.png)
Character formatting, such as bold and italic display correctly on Android.
platform Cards Reference https://github.com/MicrosoftDocs/msteams-docs/commits/main/msteams-platform/task-modules-and-cards/cards/cards-reference.md
To create a hero card, thumbnail card, or Adaptive Card from App Studio:
1. Select **Create a new card**. 1. Select **Create** for one of the cards from **Hero Card**, **Thumbnail Card**, or **Adaptive Card**. The metadata details, buttons, and json, csharp, and node code examples are shown for that card.
- ![Hero card details](~/assets/images/Cards/Herocarddetails.png)
+ :::image type="content" source="../../assets/images/Cards/Herocarddetails.png" alt-text="Hero card details":::
1. Select **Send me this card**. The card is sent to you as a chat message.
The following table provides the properties of a hero card:
### Example of a hero card
-![Example of a hero card](~/assets/images/cards/hero.png)
The following code shows an example of a hero card:
The following table provides the features that support receipt cards:
### Example of a receipt card
-![Example of a receipt card](~/assets/images/cards/receipt.png)
The following code shows an example of a receipt card:
The following table provides the features that support thumbnail cards:
| | | | | | Γ£ö | Γ£ö | Γ£û | Γ£ö |
-![Example of a thumbnail card](~/assets/images/cards/thumbnail.png)
### Properties of a thumbnail card
Properties of a carousel card are same as the hero and thumbnail cards.
#### Example of a carousel collection
-![Example of a carousel of cards](~/assets/images/cards/carousel.png)
The following code shows an example of a carousel collection:
The following table provides the features that support list collections:
#### Example of a list collection
-![Example of a list of cards](~/assets/images/cards/list.png)
Properties of list collections are same as the hero or thumbnail cards.
platform Dynamic Search https://github.com/MicrosoftDocs/msteams-docs/commits/main/msteams-platform/task-modules-and-cards/cards/dynamic-search.md
Dynamic typeahead search is useful to search and select data from large data set
# [Desktop](#tab/desktop)
-![Dynamic typeahead search](~/assets/images/Cards/dynamic-typeahead-search-desktop.png)
-![Dynamic typeahead search image 2](~/assets/images/Cards/dynamic-typeahead-search-desktop-2.png)
# [Mobile](#tab/mobile)
platform People Picker https://github.com/MicrosoftDocs/msteams-docs/commits/main/msteams-platform/task-modules-and-cards/cards/people-picker.md
The code example for creating People Picker with organization search is as follo
The following image illustrates People Picker in Adaptive Cards with organization search:
-![People Picker Org Search](../../assets/images/cards/peoplepicker-org-search.png)
To enable search within a list of conversation members, use the appropriate dataset defined in the [dataset](#dataset) table. `isMultiSelect` property is used to enable the selection of multiple users in the control. It's set to false by default and this setting allows you to select single user only.
The following example describes static choices:
The following image illustrates People Picker in Adaptive Cards with static choices in organization search:
-![People Picker static choice](../../assets/images/cards/peoplepicker-static-choice.png)
You can implement People Picker for efficient task management in different scenarios.
platform Invoking Task Modules https://github.com/MicrosoftDocs/msteams-docs/commits/main/msteams-platform/task-modules-and-cards/task-modules/invoking-task-modules.md
Using integers for `TaskInfo.width` and `TaskInfo.height`, sets the height and w
If `TaskInfo.width` and `TaskInfo.height` are `"small"`, `"medium"`, or `"large"`, the size of the red rectangle in the following image is a proportion of the available space, 20%, 50%, and 60% for `width` and 20%, 50%, and 66% for `height`:
-![Task module example](~/assets/images/task-module/task-module-example.png)
Task modules invoked from a tab can be dynamically resized. After calling `tasks.startTask()` you can call `tasks.updateTask(newSize)` where height and width properties on the newSize object conform to the TaskInfo specification, for example `{ height: 'medium', width: 'medium' }`.
HTML or JavaScript-based task modules have access to the entire area of the task
YouTube offers the ability to embed videos on web pages. It is easy to embed videos on web pages in a task module using a simple stub web page.
-![YouTube video](~/assets/images/task-module/youtube-example.png)
The following code provides an example of the HTML for the web page without the CSS:
The following code provides an example of the CSS:
The user can use the same approach to embed a PowerApp as well. As the height or width of any individual PowerApp is customizable, the user can adjust the height and width to achieve the desired presentation.
-![Asset management PowerApp](~/assets/images/task-module/powerapp-example.png)
The following code provides an example of the HTML for PowerApp:
platform Task Modules Bots https://github.com/MicrosoftDocs/msteams-docs/commits/main/msteams-platform/task-modules-and-cards/task-modules/task-modules-bots.md
The next section provides details on invoking a task module using `task/fetch`.
When the `value` object of the `invoke` card action or `Action.Submit` is initialized and when a user selects the button, an `invoke` message is sent to the bot. In the HTTP response to the `invoke` message, there is a [TaskInfo object](~/task-modules-and-cards/task-modules/invoking-task-modules.md#the-taskinfo-object) embedded in a wrapper object, which Teams uses to display the task module.
-![task/fetch request or response](~/assets/images/task-module/task-module-invoke-request-response.png)
The following steps provides the invoke task module using task/fetch:
platform Task Modules Tabs https://github.com/MicrosoftDocs/msteams-docs/commits/main/msteams-platform/task-modules-and-cards/task-modules/task-modules-tabs.md
The next section gives an example of invoking a task module.
The following image displays the task module:
-![Task Module - Custom Form](~/assets/images/task-module/task-module-custom-form.png)
The following code is adapted from [the task module sample](~/task-modules-and-cards/task-modules/invoking-task-modules.md#code-sample):
platform What Are Task Modules https://github.com/MicrosoftDocs/msteams-docs/commits/main/msteams-platform/task-modules-and-cards/what-are-task-modules.md
Task modules can be invoked in three ways:
Here is what a task module looks like when invoked from a bot:
-![Task module example](~/assets/images/task-module/task-module-example.png)
A task module includes the following as shown in the previous image:
platform Teamsfx SDK https://github.com/MicrosoftDocs/msteams-docs/commits/main/msteams-platform/toolkit/TeamsFx-SDK.md
Last updated 11/29/2021
-# TeamsFx SDK for TypeScript or JavaScript
+# TeamsFx SDK
-TeamsFx aims to reduce tasks of implementing identity and access to cloud resources to single-line statements with zero configuration.
+TeamsFx helps to reduce the developer tasks by leveraging Teams SSO and accessing cloud resources down to single line statements with zero configuration. TeamsFx SDK is built to be used in browser and Node.js environment, common scenarios include:
-Use the library to:
+* Teams tab application
+* Azure Function
+* Teams bot
-* Access core functionalities in client and server environment in a similar way.
-* Write user authentication code in a simplified way.
+You can use the TeamsFx SDK to:
-## Get started
+* Access the core functionalities in client and server environment
+* Write user authentication code in a simplified way
-TeamsFx SDK is pre-configured in scaffolded project using TeamsFx toolkit or CLI.
-For more information, see [Teams app project](https://github.com/OfficeDev/TeamsFx/blob/main/packages/vscode-extension/README.md).
+## Prerequisites
-### Prerequisites
+Install the following tools and set up your development environment:
-* Node.js version `10.x.x` or later.
-* If your project has installed `botbuilder` related [packages](https://github.com/Microsoft/botbuilder-js#packages) as dependencies, ensure they are of the same version and the version is `>= 4.9.3`. ([Issue - all of the BOTBUILDER packages should be the same version](https://github.com/BotBuilderCommunity/botbuilder-community-js/issues/57#issuecomment-508538548))
+* Latest version of Node.js
+* If your project has installed `botbuilder` related [packages](https://github.com/Microsoft/botbuilder-js#packages) as dependencies, ensure they are of the same version. Currently, the required version is 4.15.0 or later, for more information, see [bot builder packages should be of the same version](https://github.com/BotBuilderCommunity/botbuilder-community-js/issues/57#issuecomment-508538548).
-For more information, see:
+You must have working knowledge of the following:
* [Source code](https://github.com/OfficeDev/TeamsFx/tree/main/packages/sdk) * [Package (NPM)](https://www.npmjs.com/package/@microsoft/teamsfx) * [API reference documentation](https://aka.ms/teamsfx-sdk-help) * [Samples](https://github.com/OfficeDev/TeamsFx-Samples)
+## Get started
+
+TeamsFx SDK is pre-configured in the scaffolded project using TeamsFx Toolkit or CLI.
+For more information, see [Teams app project](https://github.com/OfficeDev/TeamsFx/blob/main/packages/vscode-extension/README.md).
+ ### Install the `@microsoft/teamsfx` package Install the TeamsFx SDK for TypeScript or JavaScript with `npm`:
Install the TeamsFx SDK for TypeScript or JavaScript with `npm`:
npm install @microsoft/teamsfx ```
-### Create and authenticate `MicrosoftGraphClient`
+### Create `MicrosoftGraphClient` service
-To create graph client object for accessing Microsoft Graph API, you will need the credentials to authenticate. The SDK provides several credential classes to choose that meets various requirements. You need to load configuration before using any credentials.
+To create a graph client object and to access the Microsoft Graph API, you need the credentials to authenticate. The SDK provides APIs to configure for developers.
-* In browser environment, you need to explicitly pass in the configuration parameters. The scaffolded React project has provided environment variables to use.
+<br>
-```ts
-loadConfiguration({
- authentication: {
- initiateLoginEndpoint: process.env.REACT_APP_START_LOGIN_PAGE_URL,
- clientId: process.env.REACT_APP_CLIENT_ID,
- },
-});
-```
+<details>
+<summary><b>Invoke Graph API on behalf of Teams User (User Identity)</b></summary>
-* In NodeJS environment like Azure Function, you can just call `loadConfiguration`. It will load from environment variables by default.
+Use the following snippet:
```ts
-loadConfiguration();
+// Equivalent to:
+// const teamsfx = new TeamsFx(IdentityType.User, {
+// initiateLoginEndpoint: process.env.REACT_APP_START_LOGIN_PAGE_URL,
+// clientId: process.env.REACT_APP_CLIENT_ID,
+// }
+const teamsfx = new TeamsFx();
+const graphClient = createMicrosoftGraphClient(teamsfx, ["User.Read"]); // Initializes MS Graph SDK using our MsGraphAuthProvider
+const profile = await graphClient.api("/me").get(); // Get the profile of current user
```
-#### Using Teams app user credential
+</details>
+
+<br>
+
+<details>
+<summary><b>Invoke Graph API without user (Application Identity)</b></summary>
+
+It doesn't require the interaction with Teams user. You can call Microsoft Graph as application identity.
Use the following snippet: ```ts
-loadConfiguration({
- authentication: {
- initiateLoginEndpoint: process.env.REACT_APP_START_LOGIN_PAGE_URL,
- clientId: process.env.REACT_APP_CLIENT_ID,
- },
-});
-const credential = new TeamsUserCredential();
-const graphClient = createMicrosoftGraphClient(credential, ["User.Read"]); // Initializes MS Graph SDK using our MsGraphAuthProvider
-const profile = await graphClient.api("/me").get();
+// Equivalent to:
+// const teamsfx = new TeamsFx(IdentityType.App, {
+// initiateLoginEndpoint: process.env.REACT_APP_START_LOGIN_PAGE_URL,
+// clientId: process.env.REACT_APP_CLIENT_ID,
+// });
+const teamsfx = new TeamsFx(IdentityType.App);
+const graphClient = createMicrosoftGraphClient(teamsfx);
+const profile = await graphClient.api("/users/{object_id_of_another_people}").get(); // Get the profile of certain user
```
+</details>
+
+<br>
+
+## Core concepts and code structure
+
+### TeamsFx class
+
+TeamsFx class instance access all TeamsFx settings from environment variables by default. You can also set customized configuration values to override the default values. Please check [override configuration](#override-configuration) for details.
+When creating a TeamsFx instance, you also need to specify the identity type.
+There are two identity types:
+
+* User Identity
+* Application Identity
+
+#### User Identity
+
+| Command | Description |
+|-|-|
+| `new TeamsFx(IdentityType.User)`| Application is authenticated as current Teams user. |
+| `TeamsFx:setSsoToken()`| User identity in Node.js environment (without browser). |
+| `TeamsFx:getUserInfo()` | To get user's basis information. |
+| `TeamsFx:login()` | It is used to let user perform consent process, if you want to use SSO to get access token for certain OAuth scopes. |
+ > [!NOTE]
-> You can use this credential class in browser application, such as Teams Tab App.
+> You can access resources on behalf of current Teams user.
-#### Using Microsoft 365 tenant credential
+#### Application Identity
-Microsoft 365 tenant credential doesn't require to interact with Teams App user. You can call Microsoft Graph as application.
+| Command | Description |
+|-|-|
+| `new TeamsFx(IdentityType.App)`| Application is authenticated as an application.The permission usually needs administrator's approval.|
+| `TeamsFx:getCredential()`| Its provides credential instances automatically corresponding to identity type. |
-Use the following snippet:
+> [!NOTE]
+> You need admin consent for resources.
-```ts
-loadConfiguration();
-const credential = new M365TenantCredential();
-const graphClient = createMicrosoftGraphClient(credential);
-const profile = await graphClient.api("/users/{object_id_of_another_people}").get();
-```
+### Credential
-## Core concepts and code structure
+You must choose identity type when initializing TeamsFx. After you have specified the identity type when initializing TeamsFx, SDK uses different kinds of credential class to represent the identity and get access token by corresponding auth flow.
+
+There are three credential classes to simplify authentication. [credential folder](https://github.com/OfficeDev/TeamsFx/tree/main/packages/sdk/src/credential). Credential classes implement `TokenCredential` interface, which is broadly used in Azure library APIs, designed to provide access tokens for specific scopes. Other APIs relies on credential call `TeamsFx:getCredential()` to get an instance of `TokenCredential`.
+
+Here's the corresponding scenarios for each credential class targets.
+
+#### User Identity in browser environment
+`TeamsUserCredential` represents Teams current user's identity. Using this credential will request user consent at the first time. It leverages the Teams SSO and On-Behalf-Of flow to do token exchange. SDK uses this credential when developer choose user identity in browser environment.
+
+Required configuration: `initiateLoginEndpoint`, `clientId`.
-### Credentials
+#### User Identity in Node.js environment
+`OnBehalfOfUserCredential` uses On-Behalf-Of flow and need Teams SSO token. It's designed to be used in Azure Function or bot scenarios. SDK uses this credential when developer choose user identity in Node.js environment.
-There are 3 credential classes located under [credential folder](https://github.com/OfficeDev/TeamsFx/tree/main/packages/sdk/src/credential) to help simplify authentication.
+Required configuration: `authorityHost`, `tenantId`, `clientId`, `clientSecret` or `certificateContent`.
-Credential classes implement `TokenCredential` interface that is broadly used in Azure library APIs. They are designed to provide access tokens for specific scopes. The following credential classes represent different identity under certain scenarios:
+#### Application Identity in Node.js environment
+`AppCredential` represents the application identity. It is usually used when user is not involved like time-triggered automation job. SDK uses this credential when developer choose App identity in Node.js environment.
-* `TeamsUserCredential` represent Teams current user's identity. Using this credential will request user consent at the first time.
-* `M365TenantCredential` represent Microsoft 365 tenant identity. It is usually used when user is not involved like time-triggered automation job.
-* `OnBehalfOfUserCredential` uses on-behalf-of flow. It needs an access token and you can get a new token for different scope. It's designed to be used in Azure Function or Bot scenarios.
+Required configuration: `tenantId`, `clientId`, `clientSecret` or `certificateContent`.
-### Bots
+### Bot SSO
Bot related classes are stored under [bot folder](https://github.com/OfficeDev/TeamsFx/tree/main/packages/sdk/src/bot).
-`TeamsBotSsoPrompt` can integrate with Bot framework. It simplifies the authentication process for developing bot application.
+`TeamsBotSsoPrompt` has a good integration with bot framework. It simplifies the authentication process when you develop bot application and want to leverage the bot SSO.
-### Helper functions
+Required configuration: `initiateLoginEndpoint`, `tenantId`, `clientId`, and `applicationIdUri`.
-TeamsFx SDK provides helper functions to ease the configuration for third-party libraries. They are located under [core folder](https://github.com/OfficeDev/TeamsFx/tree/main/packages/sdk/src/core).
+### Supported functions
-### Error handling
+TeamsFx SDK provides several functions to ease the configuration for third-party libraries. They are located under [core folder](https://github.com/OfficeDev/TeamsFx/tree/main/packages/sdk/src/core).
+
+* Microsoft Graph Service:`createMicrosoftGraphClient` and `MsGraphAuthProvider` help to create authenticated Graph instance.
+* SQL:`getTediousConnectionConfig` returns a tedious connection config.
-API error response is `ErrorWithCode`, which contains error code and error message.
+Required configuration:
+* `sqlServerEndpoint`, `sqlUsername`, `sqlPassword` if you want to use user identity
+* `sqlServerEndpoint`, `sqlIdentityId` if you want to use MSI identity
+
+### Error handling
-For example, to filter out specific error, you can use the following snippet:
+API error response is `ErrorWithCode`, which contains error code and error message. For example, to filter out specific error, you can use the following snippet:
```ts try {
- const credential = new TeamsUserCredential();
- await credential.login("User.Read");
+ const teamsfx = new TeamsFx();
+ await teamsfx.login("User.Read");
} catch (err: unknown) { if (err instanceof ErrorWithCode && err.code !== ErrorCode.ConsentFailed) { throw err; } else { // Silently fail because user cancels the consent dialog
- return;
+ return;
} } ```
-And if credential instance is used in other library such as Microsoft Graph, it's possible that error is caught and transformed.
+If credential instance is used in other library such as Microsoft Graph, it's possible that error is caught and transformed.
```ts try {
- const credential = new TeamsUserCredential();
- const graphClient = createMicrosoftGraphClient(credential, ["User.Read"]); // Initializes MS Graph SDK using our MsGraphAuthProvider
+ const teamsfx = new TeamsFx();
+ const graphClient = createMicrosoftGraphClient(teamsfx, ["User.Read"]); // Initializes MS Graph SDK using our MsGraphAuthProvider
const profile = await graphClient.api("/me").get(); } catch (err: unknown) { // ErrorWithCode is handled by Graph client
try {
The following section provides several code snippets for common scenarios:
-### Use Graph API in tab app
+<br>
-Use `TeamsUserCredential` and `createMicrosoftGraphClient`.
+<details>
+<summary><b>Use Graph API in tab app</b></summary>
+
+Use `TeamsFx` and `createMicrosoftGraphClient`.
```ts
-loadConfiguration({
- authentication: {
- initiateLoginEndpoint: process.env.REACT_APP_START_LOGIN_PAGE_URL,
- clientId: process.env.REACT_APP_CLIENT_ID,
- },
-});
-const credential: any = new TeamsUserCredential();
-const graphClient = createMicrosoftGraphClient(credential, ["User.Read"]);
+const teamsfx = new TeamsFx();
+const graphClient = createMicrosoftGraphClient(teamsfx, ["User.Read"]);
const profile = await graphClient.api("/me").get(); ```
-### Call Azure Function in tab app
+</details>
+
+<br>
+
+<details>
+<summary><b>Call Azure Function in tab app</b></summary>
Use `axios` library to make HTTP request to Azure Function. ```ts
-loadConfiguration({
- authentication: {
- initiateLoginEndpoint: process.env.REACT_APP_START_LOGIN_PAGE_URL,
- clientId: process.env.REACT_APP_CLIENT_ID,
- },
-});
-const credential: any = new TeamsUserCredential();
-const token = credential.getToken(""); // Get SSO token for the user
+const teamsfx = new TeamsFx();
+const token = teamsfx.getCredential().getToken(""); // Get SSO token for the use
// Call API hosted in Azure Functions on behalf of user
-const apiConfig = getResourceConfiguration(ResourceType.API);
-const response = await axios.default.get(apiConfig.endpoint + "api/httptrigger1", {
+const apiEndpoint = teamsfx.getConfig("apiEndpoint");
+const response = await axios.default.get(apiEndpoint + "api/httptrigger1", {
headers: { authorization: "Bearer " + token, }, }); ```
-### Access SQL database in Azure Function
+</details>
+
+<br>
+
+<details>
+<summary><b>Access SQL database in Azure Function</b></summary>
+ Use `tedious` library to access SQL and leverage `DefaultTediousConnectionConfiguration` that manages authentication. Apart from `tedious`, you can also compose connection config of other SQL libraries based on the result of `sqlConnectionConfig.getConfig()`. ```ts
-loadConfiguration();
-const sqlConnectConfig = new DefaultTediousConnectionConfiguration();
+// Equivalent to:
+// const sqlConnectConfig = new DefaultTediousConnectionConfiguration({
+// sqlServerEndpoint: process.env.SQL_ENDPOINT,
+// sqlUsername: process.env.SQL_USER_NAME,
+// sqlPassword: process.env.SQL_PASSWORD,
+// });
+const teamsfx = new TeamsFx();
// If there's only one SQL database
-const config = await sqlConnectConfig.getConfig();
+const config = await getTediousConnectionConfig(teamsfx);
// If there are multiple SQL databases
-const config2 = await sqlConnectConfig.getConfig("your database name");
+const config2 = await getTediousConnectionConfig(teamsfx "your database name");
const connection = new Connection(config); connection.on("connect", (error) => { if (error) {
connection.on("connect", (error) => {
}); ```
-### Use certificate-based authentication in Azure Function
+</details>
+
+<br>
+
+<details>
+<summary><b>Use certificate-based authentication in Azure Function</b></summary>
```ts
-loadConfiguration({
- authentication: {
- clientId: process.env.M365_CLIENT_ID,
- certificateContent: "The content of a PEM-encoded public/private key certificate",
- authorityHost: process.env.M365_AUTHORITY_HOST,
- tenantId: process.env.M365_TENANT_ID,
- },
+const authConfig = {
+ clientId: process.env.M365_CLIENT_ID,
+ certificateContent: "The content of a PEM-encoded public/private key certificate",
+ authorityHost: process.env.M365_AUTHORITY_HOST,
+ tenantId: process.env.M365_TENANT_ID,
+};
+const teamsfx = new TeamsFx(IdentityType.App);
+teamsfx.setCustomeConfig({
+ certificateContent: "The content of a PEM-encoded public/private key certificate"
});
+const token = teamsfx.getCredential().getToken();
```
-### Use Graph API in Bot application
+</details>
+
+<br>
+
+<details>
+<summary><b>Use Graph API in bot application</b></summary>
Add `TeamsBotSsoPrompt` to dialog set.
const convoState = new ConversationState(new MemoryStorage());
const dialogState = convoState.createProperty("dialogState"); const dialogs = new DialogSet(dialogState);
-loadConfiguration();
+const teamsfx = new TeamsFx();
dialogs.add(
- new TeamsBotSsoPrompt("TeamsBotSsoPrompt", {
+ new TeamsBotSsoPrompt(teamsfx, "TeamsBotSsoPrompt", {
scopes: ["User.Read"], }) );
dialogs.add(
); ```
-## Troubleshooting
+</details>
+
+<br>
+
+## Advanced Customization
### Configure log
setLogLevel(LogLevel.Warn);
You can redirect log output by setting custom logger or log function.
-##### Redirect by setting custom logger
+#### Redirect by setting custom logger
```ts setLogLevel(LogLevel.Info);
setLogLevel(LogLevel.Info);
setLogger(context.log); ```
-##### Redirect by setting custom log function
+#### Redirect by setting custom log function
> [!NOTE] > Log function will not take effect, if you set a custom logger.
setLogFunction((level: LogLevel, message: string) => {
}); ```
+## Override configuration
+You can pass custom config when creating TeamsFx instance to override default configuration or set required fields when environment variables are missing.
+
+- If you have created tab project using VS Code Toolkit, the following config values will be used from pre-configured environment variables:
+ * authorityHost (REACT_APP_AUTHORITY_HOST)
+ * tenantId (REACT_APP_TENANT_ID)
+ * clientId (REACT_APP_CLIENT_ID)
+ * initiateLoginEndpoint (REACT_APP_START_LOGIN_PAGE_URL)
+ * applicationIdUri (REACT_APP_START_LOGIN_PAGE_URL)
+ * apiEndpoint (REACT_APP_FUNC_ENDPOINT)
+ * apiName (REACT_APP_FUNC_NAME)
+
+- If you have created Azure Function / bot project using VS Code Toolkit, the following config values will be used from pre-configured environment variables:
+ * initiateLoginEndpoint (INITIATE_LOGIN_ENDPOINT)
+ * authorityHost (M365_AUTHORITY_HOST)
+ * tenantId (M365_TENANT_ID)
+ * clientId (M365_CLIENT_ID)
+ * clientSecret (M365_CLIENT_SECRET)
+ * applicationIdUri (M365_APPLICATION_ID_URI)
+ * apiEndpoint (API_ENDPOINT)
+ * sqlServerEndpoint (SQL_ENDPOINT)
+ * sqlUsername (SQL_USER_NAME)
+ * sqlPassword (SQL_PASSWORD)
+ * sqlDatabaseName (SQL_DATABASE_NAME)
+ * sqlIdentityId (IDENTITY_ID)
+
+## Upgrade latest SDK version
+
+If you are using the version of SDK that has `loadConfiguration()`, you can follow these steps to upgrade to the latest SDK version.
+1. Remove `loadConfiguration()` and pass customized settings using `new TeamsFx(IdentityType.User, { ...customConfig })`
+2. Replace `new TeamsUserCredential()` with `new TeamsFx()`
+3. Replace `new M365TenantCredential()` with `new TeamsFx(IdentityType.App)`
+4. Replace `new OnBehalfOfUserCredential(ssoToken)` with `new TeamsFx().setSsoToken(ssoToken)`
+5. Pass the instance of `TeamsFx` to helper functions to replace credential instance
+
+For more information, see [TeamsFx class](#teamsfx-class).
+
+## Next step
+
+[Samples](https://github.com/OfficeDev/TeamsFx-Samples) project for detailed examples on how to use TeamsFx SDK.
+ ## See also
-[Microsoft TeamsFx sample gallery](https://github.com/OfficeDev/TeamsFx-Samples)
+[Microsoft TeamsFx sample gallery](https://github.com/OfficeDev/TeamsFx-Samples).
platform Teamsfx Manifest Customization https://github.com/MicrosoftDocs/msteams-docs/commits/main/msteams-platform/toolkit/TeamsFx-manifest-customization.md
Last updated 11/29/2021
-# Customize app manifest in Teams Toolkit
+# Customize app manifest in Toolkit
-Teams Toolkit consists of the following manifest template files under `templates/appPackage` folder:
+Teams Toolkit consists of the following manifest template files under `manifest.template.json` folder across local and remote environments:
+
+* `manifest.template.json`
+* `templates/appPackage`
-* `manifest.local.template.json` - local debug teams app
-* `manifest.remote.template.json` - shared in all environments
## Prerequisite
-* [Install Teams Toolkit](https://marketplace.visualstudio.com/items?itemName=TeamsDevApp.ms-teams-vscode-extension) version v3.0.0+.
+* Install the [latest version of Teams Toolkit](https://marketplace.visualstudio.com/items?itemName=TeamsDevApp.ms-teams-vscode-extension).
> [!TIP] > Ensure you have Teams app project opened in Visual Studio Code.
-During provision, Teams Toolkit loads manifest from `manifest.remote.template.json`, combined with configurations from `state.{env}.json` and `config.{env}.json`, and creates teams app in [Dev Portal](https://dev.teams.microsoft.com/apps).
+During local debug or provision, Teams Toolkit loads manifest from `manifest.template.json`, with configurations from `state.{env}.json`, `config.{env}.json`, and creates teams app in [Dev Portal](https://dev.teams.microsoft.com/apps).
+
-During local debug, Teams Toolkit loads manifest from `manifest.local.template.json`, combined with configurations from `localSettings.json`, and creates teams app in [Dev Portal](https://dev.teams.microsoft.com/apps).
+## Placeholders supported in manifest.template.json
-## Supported placeholder in manifest.remote.template.json
+* `{{state.xx}}` is pre-defined placeholder and it's value is resolved by Teams Toolkit, defined in `state.{env}.json`. Ensure not to modify the values in state.{env}.json
+* `{{config.manifest.xx}}` is customized placeholder and it's value is resolved from `config.{env}.json`
-* `{{state.xx}}` is pre-defined placeholder whose value is resolved by Teams Toolkit, defined in `state.{env}.json`. Ensure not to modify the values in state.{env}.json.
-* `{{config.manifest.xx}}` is customized placeholder whose value is resolved from `config.{env}.json`.
- * You can add a customized parameter as follows:
- * Add a placeholder in manifest.remote.template.json with pattern: `{{config.manifest.xx}}`
- * Add a config value in config.{env}.json
+ 1. You can add a customized parameter as follows:
+ 1. Add a placeholder in manifest.template.json with pattern: `{{config.manifest.xx}}`
+ 2. Add a config value in config.{env}.json
```json {
During local debug, Teams Toolkit loads manifest from `manifest.local.template.j
} ```
- Besides each config placeholder in `manifest.remote.template.json`, there is a `Go to config file`. You can navigate to configuration file by selecting it.
-
-## Supported placeholder in manifest.local.template.json
-
-`{{localSettings.xx}}` is pre-defined placeholder whose value is resolved by Teams Toolkit, defined in `localSettings.json`. Ensure not to modify the values in localSettings.json.
-
- > [!NOTE]
- > Ensure not to customize the local manifest.
+ 2. You can navigate to configuration file by selecting any one of the config placeholder **Go to config file** or **View the state file** in `manifest.template.json`
## See also
platform Teamsfx Manifest Preview https://github.com/MicrosoftDocs/msteams-docs/commits/main/msteams-platform/toolkit/TeamsFx-manifest-preview.md
Last updated 11/29/2021
-# Preview Teams app manifest in Teams Toolkit
+# Preview app manifest in Toolkit
-After scaffolding, the following are the manifest template files available under `templates/appPackage` folder:
-
-* `manifest.local.template.json` - local debug teams app.
-* `manifest.remote.template.json` - shared between all remote environments.
-
-The Template files consisting placeholders, and the actual values from Teams Toolkit are resolved in files under `.fx/configs` and `.fx/states`.
+The manifest template file `manifest.template.json` is available under `templates/appPackage` folder after scaffolding. The Template file with placeholders, and the actual values is resolved by Teams Toolkit from files under `.fx/configs` and `.fx/states` for different environments.
## Prerequisite
-* [Install Teams Toolkit](https://marketplace.visualstudio.com/items?itemName=TeamsDevApp.ms-teams-vscode-extension) version v3.0.0+.
+* Install the [latest version of Teams Toolkit](https://marketplace.visualstudio.com/items?itemName=TeamsDevApp.ms-teams-vscode-extension)
> [!TIP] > Ensure you have Teams app project opened in Visual Studio code.
To preview manifest with real content, Teams Toolkit generates preview manifest
### Preview local manifest file
-To preview manifest file of local teams app, you need to press **F5** to run local debug. It generates default local settings for you, then the app package and preview manifest builds under **build/appPackage** folder.
+To preview manifest file of local teams app, you can press **F5** to run local debug. It generates default local settings for you, then the app package and preview manifest builds under `build/appPackage` folder.
You can also preview local manifest by following the steps:
-1. Select **Preview** in the codelens of **manifest.local.template.json** file.
-2. Select **Preview manifest file** at the menu bar of **manifest.local.template.json** file.
-3. Select **Zip Teams metadata package** in Treeview and select **Local**.
+1. Select **Preview** in the codelens of `manifest.template.json` file and select **local**
+2. Select **Preview manifest file** on the menu bar of `manifest.template.json` file
+3. Select **Zip Teams metadata package** in Treeview and select **local**
+ The preview local appears as shown in the image: ### Preview manifest in remote environment
-To preview manifest file of remote teams app, select **Provision in the cloud** in **DEVELOPMENT** panel of Teams Toolkit extension Treeview, or trigger **Teams: Provision in the cloud** from command palette. It generates configuration for remote teams app, and builds package and preview manifest under **build/appPackage** folder.
+To preview manifest file of remote teams app, select **Provision in the cloud** in **DEVELOPMENT** panel of Teams Toolkit extension Treeview, or trigger **Teams: Provision in the cloud** from command palette. It generates configuration for remote teams app, and builds package and preview manifest under `build/appPackage` folder.
You can also preview manifest in remote environment by following the steps:
-1. Select **Preview** in the codelens of **manifest.remote.template.json** file.
-2. Select **Preview manifest file** at the menu bar of **manifest.remote.template.json** file.
-3. Select **Zip Teams metadata package** in Treeview.
-4. Select your environment.
+1. Select **Preview** in the codelens of `manifest.template.json` file
+2. Select **Preview manifest file** on the menu bar of `manifest.template.json` file
+3. Select **Zip Teams metadata package** in Treeview
+4. Select your environment
If there are more than one environment, you need to select the environment you want to preview as shown in the image: :::image type="content" source="../assets/images/teams-toolkit-v2/teams toolkit fundamentals/manifest preview-1.png" alt-text="Add env":::
-## Sync local changes to Dev portal
+## Sync local changes to Developer Portal
-After previewing the manifest file, you can sync your local changes to Dev portal by following the steps:
+After previewing the manifest file, you can sync your local changes to Developer Portal by following the steps:
-1. Select **Update to Teams platform** at the top left corner of `manifest.{env}.json`
-2. Select **Teams: Update manifest to Teams platform** at the menu bar of `manifest.{env}.json`
+1. Select **Update to Teams platform** on the top left corner of `manifest.{env}.json`
+2. Select **Teams: Update manifest to Teams platform** on the menu bar of `manifest.{env}.json`
- You can also trigger **Teams: update manifest to Teams platform** from command palette
+ You can also trigger **Teams: Update manifest to Teams platform** from command palette:
:::image type="content" source="../assets/images/teams-toolkit-v2/teams toolkit fundamentals/pre.png" alt-text="tree view"::: > [!NOTE]
-> Trigger from editor codelens or **title** will update current manifest file to Teams platform. Trigger from command palette requires selecting target environment.
+> Trigger from editor codelens or **title** updates current manifest file to Teams platform. Trigger from command palette requires selecting target environment
-If the manifest file is outdated due to configuration file change or template change, ensure to confirm the following action:
+
+
+If the manifest file is outdated due to configuration file change or template change, select any one of the following action:
+
+* **Preview only**: Local manifest file is overwritten according to current configuration
+* **Preview and update**: Local manifest file is overwritten according to current configuration and also updated to Teams platform
+* **Cancel**: No action is taken
:::image type="content" source="../assets/images/teams-toolkit-v2/teams toolkit fundamentals/manifest preview -3.png" alt-text="pre":::
-* **Preview only**: local manifest file will be overwritten according to current configuration
-* **Preview and update**: local manifest file will be overwritten according to current configuration and also updated to Teams platform
-* **Cancel**: do nothing
+ > [!NOTE]
-> The changes will be updated to dev portal. If you have some manual updates in dev portal, it will be overwritten.
+> The changes are updated in Dev Portal. Any manual updates in dev portal are overwritten.
## See also
platform Teamsfx Multi Env https://github.com/MicrosoftDocs/msteams-docs/commits/main/msteams-platform/toolkit/TeamsFx-multi-env.md
Last updated 11/29/2021
-# Manage multiple environments in Teams Toolkit
+# Manage multiple environments
Teams Toolkit provides a simple way for you to create and manage multiple environments, provision, and deploy artifacts to the target environment for Teams App.
- With multiple environments, you can perform the following:
+ You can perform the following with the multiple environments:
-1. **Test before production**: It is a common practice to set up multiple environments such as dev, test, and staging before publishing a Teams App to production environment in modern app development lifecycle.
+1. **Test before production**: You can set up multiple environments such as dev, test, and staging before publishing a Teams App to production environment in modern app development lifecycle
-2. **Manage app behaviors in different environments**: You can set different behaviors for multiple environments such as enable telemetry in production environment but disable it in development environment.
+2. **Manage app behaviors in different environments**: You can set up different behaviors for multiple environments such as enable telemetry in production environment, however disable it in development environment
## Prerequisite
-* [Install Teams Toolkit](https://marketplace.visualstudio.com/items?itemName=TeamsDevApp.ms-teams-vscode-extension) version v3.0.0+.
+* Install the [latest version of Teams Toolkit](https://marketplace.visualstudio.com/items?itemName=TeamsDevApp.ms-teams-vscode-extension).
> [!TIP] > Ensure you have Teams app project opened in Microsoft Visual Studio code. ## Create a new environment
-After creating new project, Teams Toolkit by default creates:
+After creating a new project, Teams Toolkit by default creates:
-* One `local` environment to represent the local machine environment configurations.
-* One `dev` environment to represent the remote or cloud environment configurations.
+* One `local` environment to represent the local machine environment configurations
+* One `dev` environment to represent the remote or cloud environment configurations
> [!NOTE] > Each project can have only one `local` environment but multiple remote environments.
-To add another remote environment, select the Teams icon in the sidebar, select create new environment the under Environment section as shown in the following image:
+**To add another remote environment**:
+
+1. Select the **Teams** icon in the sidebar
+2. Select **+Teams: Create new environment** under the Environment section as shown in the following image:
:::image type="content" source="../assets/images/teams-toolkit-v2/teams toolkit fundamentals/create new env.png" alt-text="create":::
-> [!NOTE]
-> If you have more than one existing environments, you need to select an existing environment to create the same. The command will copy file contents of `config.<newEnv>.json` and `azure.parameters.<newEnv>.json` from the existing environment you selected to the new environment being created.
+If you have more than one environments, you need to select an existing environment to create the same. The command copies the file contents of `config.<newEnv>.json` and `azure.parameters.<newEnv>.json` from the existing environment you selected to the new environment created.
## Select target environment
-You can select the target environment for all environment-related operations. The toolkit prompts and ask for a target environment when you have multiple remote environments as shown in the following image:
+You can select the target environment for all environment-related operations. The Toolkit prompts and ask for a target environment when you have multiple remote environments as shown in the following image:
:::image type="content" source="../assets/images/teams-toolkit-v2/teams toolkit fundamentals/manifest preview-1.png" alt-text="add env":::
You can select the target environment for all environment-related operations. Th
After creating the project, you can view the project folders and files in the explorer area of Visual Studio Code. Besides the custom codes, some files are used by Teams Toolkit to maintain the config, state, and template of the app. The following list provides files and outlines their relationship with multiple environments.
-* `.fx/configs`: configure files that user can customize for the Teams app.
- * `config.<envName>.json`: per-environment configuration file.
- * `azure.parameters.<envName>.json`: per-environment parameters file for Azure bicep provision.
- * `projectSettings.json`: global project settings , which apply to all environments.
- * `localSettings.json`: local debug configuration file.
-* `.fx/states`: provision result that is generated by the Toolkit.
- * `state.<envName>.json`: per-environment provision output file.
- * `<env>.userdata`: per-environment sensitive user data for the provision output.
+* `.fx/configs`: configure files that user can customize for the Teams app
+ * `config.<envName>.json`: configuration file for per environment
+ * `azure.parameters.<envName>.json`: per environment parameters file for Azure bicep provision
+ * `projectSettings.json`: global project settings , which apply to all environments
+* `.fx/states`: provision result that is generated by the Toolkit
+ * `state.<envName>.json`: per-environment provision output file
+ * `<env>.userdata`: per-environment sensitive user data for the provision output
* `templates`
- * `appPackage`: app manifest template files.
- * `azure`: Bicep template files.
+ * `appPackage`: app manifest template files
+ * `azure`: Bicep template files
-## Customize the provision
+## Customize resource provision
Teams Toolkit allows you to change the configuration files and template files to customize the resource provision in each environment.
-The following table lists the common scenarios supported for customized provision and where to customize:
+The following table lists the common scenarios for customized resource provision:
| Scenarios | Location| Description | | | | |
-| Customize Azure Resource | <ul> <li>Bicep files under `templates/azure`.</li> <li>`.fx/azure.parameters.<envName>.json`.</li></ul> | [Customize ARM parameters and templates](provision.md#customize-arm-parameters-and-templates). |
-| Reuse existing Azure AD app for Teams app | <ul> <li>`auth` section in`.fx/config.<envName>.json`.</li> </ul> | [Use an existing Azure AD app for your Teams app](provision.md#use-an-existing-azure-ad-app-for-your-teams-app). |
-| Reuse existing Azure AD app for bot | <ul> <li>`bot` section in`.fx/config.<envName>.json`.</li> </ul> | [Use an existing Azure AD app for your bot](provision.md#use-an-existing-azure-ad-app-for-your-bot). |
-| Skip adding user while provisioning SQL | <ul> <li>`skipAddingSqlUser` property in`.fx/config.<envName>.json`.</li> </ul> | [Skip adding user for SQL database](provision.md#skip-adding-user-for-sql-database). |
-| Customize app manifest | <ul> <li>`templates/manifest.remote.template.json`.</li> <li>`manifest` section in`.fx/config.<envName>.json`.</li> </ul> | [Customize Teams App Manifest in Teams Toolkit](TeamsFx-manifest-customization.md). |
+| Customize Azure Resource | <ul> <li>Bicep files under `templates/azure`</li> <li>`.fx/azure.parameters.<envName>.json`</li></ul> | [Customize ARM parameters and templates](provision.md#customize-arm-parameters-and-templates) |
+| Reuse existing Azure AD app for Teams app | <ul> <li>`auth` section in`.fx/config.<envName>.json`</li> </ul> | [Use an existing Azure AD app for your Teams app](provision.md#use-an-existing-azure-ad-app-for-your-teams-app) |
+| Reuse existing Azure AD app for bot | <ul> <li>`bot` section in`.fx/config.<envName>.json`</li> </ul> | [Use an existing Azure AD app for your bot](provision.md#use-an-existing-azure-ad-app-for-your-bot) |
+| Skip adding user while provisioning SQL | <ul> <li>`skipAddingSqlUser` property in`.fx/config.<envName>.json`</li> </ul> | [Skip adding user for SQL database](provision.md#skip-adding-user-for-sql-database) |
+| Customize app manifest | <ul> <li>`templates/manifest.template.json`</li> <li>`manifest` section in `.fx/config.<envName>.json`</li> </ul> | [Customize Teams App Manifest in Teams Toolkit](TeamsFx-manifest-customization.md) |
## Scenarios
-### Scenario 1: customize Teams app name for different environment
+There are four scenarios to customized the resources provision in different environments.
+<br>
+
+<br><details>
+<summary><b>Scenario 1: Customize Teams app name for different environment
+</b></summary>
You can set the Teams app name to `myapp(dev)` for the default environment `dev` and `myapp(staging)` for the staging environment `staging`. Perform the following steps for customization:
-* 1. Open config file `.fx/configs/config.dev.json`.
-* 2. Update the property of *manifest > appName > short* to `myapp(dev)`
+1. Open config file `.fx/configs/config.dev.json`
+2. Update the property of *manifest > appName > short* to `myapp(dev)`
The updates to `.fx/configs/config.dev.json` are as follows:
Perform the following steps for customization:
} ```
-* 3. Create new environment and name it `staging` if it doesn't exist.
-* 4. Open config file `.fx/configs/config.staging.json`.
-* 5. Update the same property `myapp(staging)`.
-* 6. Run provision command on `dev` and `staging` environment to update the app name in remote environments. To run provision command with Teams Toolkit, see [provision](provision.md#provision-using-teams-toolkit).
+3. Create a new environment and name it `staging` if it doesn't exist
+4. Open config file `.fx/configs/config.staging.json`
+5. Update the same property `myapp(staging)`
+6. Run provision command on `dev` and `staging` environment to update the app name in remote environments. To run provision command with Teams Toolkit, see [provision](provision.md#provision-using-teams-toolkit)
+</details>
+<br>
+
-### Scenario 2: customize Teams App description for different environment
+<details>
+<summary><b>Scenario 2: Customize Teams app description for different environment</b></summary>
-In this scenario, you will learn how to set different Teams app description for different environments:
+In this scenario, you will learn how to set different Teams app description for the different environments:
-* For the default environment `dev`, the description will be `my app description for dev`;
-* For the staging environment `staging`, the description will be `my app description for staging`;
+* For the default environment `dev`, the description is `my app description for dev`
+* For the staging environment `staging`, the description is `my app description for staging`
Perform the following steps for customization:
-* 1. Open config file `.fx/configs/config.dev.json`.
-* 2. Add new property of *manifest > description > short* with value `my app description for dev`.
+1. Open config file `.fx/configs/config.dev.json`
+2. Add new property of *manifest > description > short* with value `my app description for dev`
The updates to `.fx/configs/config.dev.json` are as follows:
Perform the following steps for customization:
} ```
-* 3. Create a new environment and name it `staging` if it doesn't exist.
-* 4. Open config file `.fx/configs/config.staging.json`.
-* 5. Add the same property to `my app description for staging`.
-* 6. Open Teams app manifest template for remote `templates/appPackage/manifest.remote.template.json`.
-* 7. Update the property `description > short` to use the **variable** defined in configure files with mustache syntax `{{config.manifest.description.short}}`.
+3. Create a new environment and name it `staging` if it doesn't exist
+4. Open config file `.fx/configs/config.staging.json`
+5. Add the same property to `my app description for staging`
+6. Open Teams app manifest template `templates/appPackage/manifest.template.json`
+7. Update the property `description > short` to use the **variable** defined in configure files with mustache syntax `{{config.manifest.description.short}}`
- The updates to `manifest.remote.template.json` are as follows:
+ The updates to `manifest.template.json` are as follows:
```json {
Perform the following steps for customization:
} ```
-* 8. Run provision command against `dev` and `staging` environment to update the app name in remote environments. To run provision command with Teams Toolkit, see [provision](provision.md#provision-using-teams-toolkit).
+8. Run provision command against `dev` and `staging` environment to update the app name in remote environments. To run provision command with Teams Toolkit, see [provision](provision.md#provision-using-teams-toolkit)
-### Scenario 3: customize Teams App description for all environments
+</details>
+<br>
-In this scenario, you will learn how to set the description of Teams app to `my app description` for all environments.
+<details>
+<summary><b>Scenario 3: Customize Teams app description for all environments</b></summary>
+
+In this scenario, you will learn how to set the description of Teams app to `my app description` for all the environments.
As the Teams app manifest template is shared across all environments, we can update the description value in it for our target:
-* 1. Open Teams app manifest template for remote `templates/appPackage/manifest.remote.template.json`.
-* 2. Update the property `description > short` with **hard-coded string** `my app description`.
+1. Open Teams app manifest template `templates/appPackage/manifest.template.json`
+2. Update the property `description > short` with **hard-coded string** `my app description`
- The updates to `manifest.remote.template.json` are as follows:
+ The updates to `manifest.template.json` are as follows:
```json {
As the Teams app manifest template is shared across all environments, we can upd
}, ... }
+ ```
+3. Run the provision command against **all** environment to update the app name in remote environments. To run provision command with Teams Toolkit, see [provision](provision.md#provision-using-teams-toolkit)
+<br></details>
+<br>
+<details>
+<br><summary><b>Scenario 4: customize Azure resources for different environment</b></summary>
+You can customize Azure resources for each environment, for example specify Azure Function name, by editing the environment corresponding to
+fx/configs/azure.parameters.{env}.json. file.
-* 3. Run provision command against **all** environment to update the app name in remote environments. To run provision command with Teams Toolkit, see [provision](provision.md#provision-using-teams-toolkit).
-
-### Scenario 4: customize Azure resources for different environment
+For more information on Bicep template and parameter files, see [provision cloud resources](provision.md)
+</details>
+<br
-You can customize Azure resources for each environment, for example specify Azure Function name, by editing the environment corresponding to `.fx/configs/azure.parameters.{env}.json` file.
-For more information on Bicep template and parameter files, see [provision cloud resources](provision.md)
## See also * [Provision cloud resources](provision.md) * [Add more cloud resources](add-resource.md)
-* [Collaborate with other developers on Teams project](TeamsFx-collaboration.md)
+* [Collaborate with other developers on Teams project](TeamsFx-collaboration.md)
platform Add Capability https://github.com/MicrosoftDocs/msteams-docs/commits/main/msteams-platform/toolkit/add-capability.md
Last updated 11/29/2021
# Add capabilities to your Teams apps
-You can create a new Teams app with one of the Teams app capabilities. During app development, you can use Teams Toolkit to add more capabilities to your Teams app. The following table lists the Teams app capabilities:
+During app development, you can create a new Teams app with Teams app capability. The following table lists the Teams app capabilities:
|**Capability**|**Description**| |--|-|
-| Tabs | Tabs are simple HTML tags that point to domains declared in the app manifest. You can add tabs as a part of channel inside a team, group chat, or personal app for an individual user.|
-| Bots | Bots help to interact with your web service through text, interactive cards, and task modules.|
-| Messaging extensions | Messaging extensions help to interact with your web service through buttons and forms in the Microsoft Teams client.|
+| Tabs | Tabs are simple HTML tags that point to domains declared in the app manifest. You can add tabs as a part of channel inside a team, group chat, or personal app for an individual user|
+| Bots | Bots help to interact with your web service through text, interactive cards, and task modules|
+| Messaging extensions | Messaging extensions help to interact with your web service through buttons and forms in the Microsoft Teams client|
## Prerequisite
-[Install Teams Toolkit](https://marketplace.visualstudio.com/items?itemName=TeamsDevApp.ms-teams-vscode-extension) version v3.0.0+.
+* Install the [latest version of Teams Toolkit](https://marketplace.visualstudio.com/items?itemName=TeamsDevApp.ms-teams-vscode-extension).
> [!TIP] > Ensure you have Teams app project opened in VS code.
-## Add capabilities using Teams Toolkit
+## Limitations
-> [!IMPORTANT]
-> You need to perform provision for each environment after you successfully add capabilities to your Teams app.
+The limitations to TeamsFx while adding more capabilities are as follows:
-1. Open **Microsoft Visual Studio Code**.
-1. Select **Teams Toolkit** from left panel.
-1. Select **Add capabilities**:
+* You can add tabs up to 16 instances
+* You can add bot and messaging extension for one instance each
+## Add capabilities
- :::image type="content" source="../assets/images/teams-toolkit-v2/manual/add capabilities.png" alt-text="capabilities":::
+> [!Note]
+> You need to perform the provision for each environment, after you successfully add capabilities to your Teams app.
+* You can add capabilities using Teams Toolkit in Visual Studio Code
+ 1. Open **Microsoft Visual Studio Code**
+ 1. Select **Teams Toolkit** from left panel
+ 1. Select **Add capabilities**
- You can also open the command palette and enter **Teams: Add Capabilities**:
+ :::image type="content" source="../assets/images/teams-toolkit-v2/manual/add capabilities.png" alt-text="capabilities":::
+
+* You can also open the command palette and enter Teams: Add Capabilities:
:::image type="content" source="../assets/images/teams-toolkit-v2/manual/tree view capabilities.png" alt-text="Alternate capabilities":::
-1. From the pop-up, select the capabilities to include in your project:
+
+ 1. From the pop-up, select the capabilities to include in your project:
:::image type="content" source="../assets/images/teams-toolkit-v2/teams toolkit fundamentals/select capabilities.png" alt-text="select":::
-1. Select **OK**.
+ 2. Select **OK**
-The selected capabilities are succesfully added to your project. The Teams Toolkit generate source code for newly added capabilities.
+The selected capabilities are successfully added to your project. The Teams Toolkit generate source code for newly added capabilities
## Add capabilities using TeamsFx CLI in command window
-1. Change directory to your **project directory**.
+1. Change directory to your **project directory**
1. Execute the following command to add different capabilities to your project: |Capability and Scenario| Command|
The selected capabilities are succesfully added to your project. The Teams Toolk
|To add bot|`teamsfx capability add bot`| |To add messaging extension|`teamsfx capability add messaging-extension`|
-## Supported capabilities matrix
+## Supported capabilities
Apart from the capabilities your Teams app already have, you can choose to add different capabilities to your Teams app. The following table provides the different Teams app capabilities:
-|Existing capabilities|Other supported capabilities can be added|
+|Existing capabilities|Other supported capabilities|
|--|--| |Tabs with SPFx|None| |Tabs with Azure|Bot and messaging extension|
Apart from the capabilities your Teams app already have, you can choose to add d
|Tabs, bot, and messaging extension|Tabs| |Tabs |Bot and message extension|
-## Add capabilities
+## Add bot, tab and messaging extension
-After adding bot and messaging extension, the changes in your project are as follows:
+After adding a bot and messaging extension, the changes in your project are as follows:
-* A bot template code is added into a subfolder with path `yourProjectFolder/bot`. This includes a **hello world** bot application template into your project.
-* `launch.json` and `task.json` under `.vscode` folder are updated, which includes necessary scripts for Visual Studio Code, and is executed when you want to debug your application locally.
-* `manifest.remote.template.json` and `manifest.local.template.json` file under `templates/appPackage` folder are updated, which includes bot related information in the manifest file that represents your application in the Teams Platform. The changes are as follows:
- * The ID of your bot.
- * The scopes of your bot.
- * The commands that hello world bot application can respond to.
-* The files under `templates/azure/teamsfx` will be updated, and `templates/azure/provision/xxx`.bicep file will be regenerated.
-* The files under `.fx/config` are regenerated, which ensures your project is set with right configurations for newly added capability.
+* A bot template code is added into a subfolder with path `yourProjectFolder/bot`. This includes a **hello world** bot application template into your project
+* `launch.json` and `task.json` under `.vscode` folder are updated, which includes necessary scripts for Visual Studio Code, and is executed when you want to debug your application locally
+* `manifest.template.json` file under `templates/appPackage` folder is updated, which includes the bot related information in the manifest file that represents your application in the Teams Platform. The changes are as follows:
+ * The ID of your bot
+ * The scopes of your bot
+ * The commands that hello world bot application can respond to
+* The files under `templates/azure/teamsfx` are be updated, and `templates/azure/provision/xxx`.bicep files are regenerated
+* The files under `.fx/config` are regenerated, which ensures your project is set with right configurations for newly added capability
After adding tab, the changes in your project are as follows:
-* A frontend tab template code is added into a subfolder with path `yourProjectFolder/tab`, which includes a **hello world** tab application template into your project.
-* `launch.json` and `task.json` under `.vscode` folder are updated, which includes necessary scripts for Visual Studio Code, and is executed when you want to debug your application locally.
-* `manifest.remote.template.json` and `manifest.local.template.json` file under `templates/appPackage` folder are updated, which includes tab-related information in the manifest file that represents your application in the Teams Platform, the changes are as follows:
- * The configurable and static tabs.
- * The scopes of the tabs.
-* The files under `templates/azure/teamsfx` will be updated, and `templates/azure/provision/xxx`.bicep file will be regenerated.
-* The file under `.fx/config` are regenerated, which ensures your project is set with right configurations for newly added capability.
-
-## Limitations
+* A frontend tab template code is added into a subfolder with path `yourProjectFolder/tab`, which includes a **hello world** tab application template into your project
+* `launch.json` and `task.json` under `.vscode` folder are updated, which includes necessary scripts for Visual Studio Code, and is executed when you want to debug your application locally
+* `manifest.template.json` file under `templates/appPackage` folder is updated, which includes tab-related information in the manifest file that represents your application in the Teams Platform. The changes are:
+ * The configurable and static tabs
+ * The scopes of the tabs
+* The files under `templates/azure/teamsfx` will be updated, and `templates/azure/provision/xxx`.bicep file will be regenerated
+* The file under `.fx/config` are regenerated, which ensures your project is set with right configurations for newly added capability
-The limitations to TeamsFx while adding more capabilities are as follows:
-* You can add tabs up to 16 instances.
-* You can add bot and messaging extension for one instance each.
## See also
platform Debug Background Process https://github.com/MicrosoftDocs/msteams-docs/commits/main/msteams-platform/toolkit/debug-background-process.md
Last updated 03/03/2022
# Debug background process
-The local debug workflow involves the `.vscode/launch.json` and `.vscode/tasks.json` files to configure the debugger in Visual Studio Code, then the Visual Studio Code launches the debuggers, and Microsoft Edge or Chrome debugger launches a new browser instance as follows:
+The local debug workflow involves the `.vscode/launch.json` and `.vscode/tasks.json` files to configure the debugger in VS Code, then the VS Code launches the debuggers, and Microsoft Edge or Chrome debugger launches a new browser instance as follows:
-1. The `launch.json` file configures the debugger in Visual Studio Code.
+1. The `launch.json` file configures the debugger in VS Code
-2. Visual Studio Code runs the compound `preLaunchTask`, `Pre Debug Check & Start All` in `.vscode/tasks.json` file.
+2. VS Code runs the compound **preLaunchTask**, **Pre Debug Check & Start All** in `.vscode/tasks.json` file
-3. Visual Studio Code then launches the debuggers specified in the compound configurations, such as **Attach to Bot**, **Attach to Backend**, **Attach to Frontend**, and **Launch Bot**.
+3. VS Code then launches the debuggers specified in the compound configurations, such as **Attach to Bot**, **Attach to Backend**, **Attach to Frontend**, and **Launch Bot**
-4. Microsoft Edge or Chrome debugger launches a new browser instance and opens a web page to load Teams client.
+4. Microsoft Edge or Chrome debugger launches a new browser instance and opens a web page to load Teams client
## Prerequisites
Teams Toolkit checks the following prerequisites during the debug process:
|Messaging extension | 10, 12, **14 (recommended)**, 16 |
-* Microsoft 365 account with valid credentials, the Teams toolkit prompts you to sign in to Microsoft 365 account, if you haven't signed in.
+* Microsoft 365 account with valid credentials, the Teams toolkit prompts you to sign in to Microsoft 365 account, if you haven't signed in
-* Custom app uploading or sideloading for your developer tenant is turned on. If not, the local debug terminates.
+* Custom app uploading or sideloading for your developer tenant is turned on, if not then the local debug terminates
-* Ngrok binary version 2.3, applicable for bot and messaging extension. If Ngrok is not installed or the version doesn't match the requirement, the Teams toolkit installs Ngrok NPM package `ngrok@4.2.2` in `~/.fx/bin/ngrok`. The Ngrok binary is managed by Ngrok NPM package in `/.fx/bin/ngrok/node modules/ngrok/bin`.
+* Ngrok binary version 2.3 is applicable for bot and messaging extension, if Ngrok isn't installed or the version doesn't match the requirement, the Teams toolkit installs Ngrok NPM package `ngrok@4.2.2` in `~/.fx/bin/ngrok`. The Ngrok binary is managed by Ngrok NPM package in `/.fx/bin/ngrok/node modules/ngrok/bin`
-* Azure Functions Core Tools version 3. If Azure Functions Core Tools is not installed or the version doesn't match the requirement, the Teams toolkit installs Azure Functions Core Tools NPM package, azure-functions-core-tools@3 for **Windows** and for **macOs** in `~/.fx/bin/func`. The Azure Functions Core Tools NPM package in `~/.fx/bin/func/node_modules/azure-functions-core-tools/bin` manages Azure Functions Core Tools binary. For Linux, the local debug terminates.
+* Azure Functions Core Tools version 3, if Azure Functions Core Tools is'nt installed or the version doesn't match the requirement, the Teams Toolkit installs Azure Functions Core Tools NPM package, azure-functions-core-tools@3 for **Windows** and for **macOs** in `~/.fx/bin/func`. The Azure Functions Core Tools NPM package in `~/.fx/bin/func/node_modules/azure-functions-core-tools/bin` manages Azure Functions Core Tools binary. For Linux, the local debug terminates
-* .NET Core SDK version, applicable for Azure Functions. If .NET Core SDK is not installed or the version doesn't match the requirement, the Teams Toolkit installs .NET Core SDK for Windows and MacOS in `~/.fx/bin/dotnet`. For Linux, the local debug terminates.
+* .NET Core SDK version applicable for Azure Functions, if .NET Core SDK is'nt installed or the version doesn't match the requirement, the Teams Toolkit installs .NET Core SDK for Windows and MacOS in `~/.fx/bin/dotnet`. For Linux, the local debug terminates
The following table lists the .NET Core versions:
Teams Toolkit checks the following prerequisites during the debug process:
|Windows, macOs (x64), and Linux | **3.1 (recommended)**, 5.0, 6.0 | |macOs (arm64) |6.0 |
-* Development certificate, if the development certificate for localhost is not installed for tab in Windows or macOS, the Teams toolkit prompts you to install it.
+* Development certificate, if the development certificate for localhost is'nt installed for tab in Windows or macOS, the Teams toolkit prompts you to install it
-* Azure Functions binding extensions defined in `api/extensions.csproj`. If Azure Functions binding extensions is not installed, the Teams Toolkit installs Azure Functions binding extensions.
+* Azure Functions binding extensions defined in `api/extensions.csproj`, if Azure Functions binding extensions is not installed, the Teams Toolkit installs Azure Functions binding extensions
-* NPM packages, applicable for tab app, bot app, messaging extension app, and Azure Functions. If NPM is not installed, the Teams Toolkit installs all NPM packages.
+* NPM packages, applicable for tab app, bot app, messaging extension app, and Azure Functions. If NPM is'nt installed, the Teams Toolkit installs all NPM packages
-* Bot and messaging extension. The Teams Toolkit starts Ngrok to create a HTTP tunnel for bot and messaging extension.
+* Bot and messaging extension, the Teams Toolkit starts Ngrok to create an HTTP tunnel for bot and messaging extension
-* Ports available, if tab, bot, messaging extension, and Azure Functions ports are unavailable, the local debug terminates.
+* Ports available, if tab, bot, messaging extension, and Azure Functions ports are unavailable, the local debug terminates
The following table lists the ports available for components:
Teams Toolkit checks the following prerequisites during the debug process:
|Project type|Installation| Limitation| |-|--|--|
-|Tab without Azure functions | Node.js LTS versions 10, 12, **14 (recommended)**, 16 | The local debug terminates, if Node.js is not installed or the version doesn't match the requirement.|
-|Tab with Azure functions | Node.js LTS versions 10, 12, **14 (recommended)** |The local debug terminates, if Node.js is not installed or the version doesn't match the requirement.|
-|Bot | Node.js LTS versions 10, 12, **14 (recommended)**, 16|The local debug terminates, if Node.js is not installed or the version doesn't match the requirement.|
-|Messaging extension | Node.js LTS versions 10, 12, **14 (recommended)**, 16 |The local debug terminates, if Node.js is not installed or the version doesn't match the requirement.|
+|Tab without Azure functions | Node.js LTS versions 10, 12, **14 (recommended)**, 16 | The local debug terminates, if Node.js isn't installed or the version doesn't match the requirement.|
+|Tab with Azure functions | Node.js LTS versions 10, 12, **14 (recommended)** |The local debug terminates, if Node.js isn't installed or the version doesn't match the requirement.|
+|Bot | Node.js LTS versions 10, 12, **14 (recommended)**, 16|The local debug terminates, if Node.js isn't installed or the version doesn't match the requirement.|
+|Messaging extension | Node.js LTS versions 10, 12, **14 (recommended)**, 16 |The local debug terminates, if Node.js isn't installed or the version doesn't match the requirement.|
|Sign in to Microsoft 365 account | Microsoft 365 credentials |Teams toolkit prompts you to sign in to Microsoft 365 account, if you haven't signed in. |
-|Bot, messaging extension | Ngrok version 2.3| ΓÇó If Ngrok is not installed or the version doesn't match the requirement, the Teams toolkit installs Ngrok NPM package `ngrok@4.2.2` in `~/.fx/bin/ngrok`. </br> ΓÇó The Ngrok binary is managed by Ngrok NPM package in `/.fx/bin/ngrok/node modules/ngrok/bin`.|
-|Azure functions | Azure Functions Core Tools version 3| ΓÇó If Azure Functions Core Tools is not installed or the version doesn't match the requirement, the Teams toolkit installs Azure Functions Core Tools NPM package, azure-functions-core-tools@3 for **Windows** and for **macOs** in `~/.fx/bin/func`. </br> ΓÇó The Azure Functions Core Tools NPM package in `~/.fx/bin/func/node_modules/azure-functions-core-tools/bin` manages Azure Functions Core Tools binary. For Linux, the local debug terminates.|
-|Azure functions |.NET Core SDK version|ΓÇó If .NET Core SDK is not installed or the version doesn't match the requirement, the toolkit installs .NET Core SDK for Windows and macOS in `~/.fx/bin/dotnet`.</br> ΓÇó For Linux, the local debug terminates.|
-|Azure functions | Azure functions binding extensions defined in `api/extensions.csproj`| If Azure functions binding extensions is not installed, the toolkit installs Azure functions binding extensions.|
-|NPM packages| NPM packages for tab app, bot app, messaging extension app, and Azure functions|If NPM is not installed, the toolkit installs all NPM packages.|
+|Bot, messaging extension | Ngrok version 2.3| ΓÇó If Ngrok isn't installed or the version doesn't match the requirement, the Teams toolkit installs Ngrok NPM package `ngrok@4.2.2` in `~/.fx/bin/ngrok`. </br> ΓÇó The Ngrok binary is managed by Ngrok NPM package in `/.fx/bin/ngrok/node modules/ngrok/bin`.|
+|Azure functions | Azure Functions Core Tools version 3| ΓÇó If Azure Functions Core Tools isn't installed or the version doesn't match the requirement, the Teams toolkit installs Azure Functions Core Tools NPM package, azure-functions-core-tools@3 for **Windows** and for **macOs** in `~/.fx/bin/func`. </br> ΓÇó The Azure Functions Core Tools NPM package in `~/.fx/bin/func/node_modules/azure-functions-core-tools/bin` manages Azure Functions Core Tools binary. For Linux, the local debug terminates.|
+|Azure functions |.NET Core SDK version|ΓÇó If .NET Core SDK isn't installed or the version doesn't match the requirement, the toolkit installs .NET Core SDK for Windows and macOS in `~/.fx/bin/dotnet`.</br> ΓÇó For Linux, the local debug terminates.|
+|Azure functions | Azure functions binding extensions defined in `api/extensions.csproj`| If Azure functions binding extensions isn't installed, the toolkit installs Azure functions binding extensions.|
+|NPM packages| NPM packages for tab app, bot app, messaging extension app, and Azure functions|If NPM isn't installed, the toolkit installs all NPM packages.|
|Bot and messaging extension | Ngrok |Toolkit starts Ngrok to create a HTTP tunnel for bot and messaging extension. | > [!NOTE]
Use the following .NET Core versions:
> [!NOTE]
-> If the development certificate for localhost is not installed for tab in Windows or macOS, the Teams toolkit prompts you to install it.</br> -->
+> If the development certificate for localhost isn't installed for tab in Windows or macOS, the Teams toolkit prompts you to install it.</br> -->
When you select **Start Debugging (F5)**, the Teams Toolkit output channel displays the progress and result after checking the prerequisites.
When you select **Start Debugging (F5)**, the Teams Toolkit output channel displ
In the set up process, Teams Toolkit prepares the following registrations and configurations for your Teams app:
-1. [Registers and configures Azure AD application](#registers-and-configures-azure-ad-application): Teams Toolkit registers and configures your Azure AD application.
+1. [Registers and configures Azure AD application](#registers-and-configures-azure-ad-application): Teams Toolkit registers and configures your Azure AD application
-1. [Registers and configures bot](#registers-and-configures-bot): Teams Toolkit registers and configures your bot for tab or messaging extension app.
+1. [Registers and configures bot](#registers-and-configures-bot): Teams Toolkit registers and configures your bot for tab or messaging extension app
-1. [Registers and configures Teams app](#registers-and-configures-teams-app): Teams Toolkit registers and configures your Teams app.
+1. [Registers and configures Teams app](#registers-and-configures-teams-app): Teams Toolkit registers and configures your Teams app
### Registers and configures Azure AD application
-1. Registers an Azure AD application.
+1. Registers an Azure AD application
-1. Creates a Client Secret.
+1. Creates a Client Secret
-1. Exposes an API.
+1. Exposes an API
- a. Configures Application ID URI. For tab, `api://localhost/{appId}`. For bot or messaging extension, `api://botid-{botid}`.
+ a. Configures Application ID URI. For tab, `api://localhost/{appId}`. For bot or messaging extension, `api://botid-{botid}`
- b. Adds a scope named `access_as_user`. Enables it for **Admin and users**.
+ b. Adds a scope named `access_as_user`. Enables it for **Admin and users**
-The following table lists the configurations of Microsoft 365 client application with the client Ids:
- | Microsoft 365 client application | Client ID |
- | | |
- | Teams desktop, mobile | 1fec8e78-bce4-4aaf-ab1b-5451cc387264 |
- | Teams web | 5e3ce6c0-2b1f-4285-8d4b-75ee78787346 |
- | Office.com | 4345a7b9-9a63-4910-a426-35363201d503 |
- | Office.com | 4765445b-32c6-49b0-83e6-1d93765276ca |
- | Office desktop | 0ec893e0-5785-4de6-99da-4ed124e5296c |
- | Outlook desktop | d3590ed6-52b3-4102-aeff-aad2292ab01c |
- | Outlook Web Access | 00000002-0000-0ff1-ce00-000000000000 |
- | Outlook Web Access | bc59ab01-8403-45c6-8796-ac3ef710b3e3 |
-
-4. Configures API permissions. Adds Microsoft Graph permission to **User.Read**.
-
-The following table lists the configuration of the authentication as follows:
-
- | Project type | Redirect URIs for web | Redirect URIs for single-page application |
- | | | |
- | Tab | `https://localhost:53000/auth-end.html` | `https://localhost:53000/auth-end.html?clientId={appId>}` |
- | Bot or messaging extension | `https://ngrok.io/auth-end.html` | NA |
+4. Configures API permissions. Adds Microsoft Graph permission to **User.Read**
+
+ The following table lists the configuration of the authentication as follows:
+
+ | Project type | Redirect URIs for web | Redirect URIs for single-page application |
+ | | | |
+ | Tab | `https://localhost:53000/auth-end.html` | `https://localhost:53000/auth-end.html?clientId={appId>}` |
+ | Bot or messaging extension | `https://ngrok.io/auth-end.html` | NA |
+
+ The following table lists the configurations of Microsoft 365 client application with the client Ids:
+
+ | Microsoft 365 client application | Client ID |
+ | | |
+ | Teams desktop, mobile | 1fec8e78-bce4-4aaf-ab1b-5451cc387264 |
+ | Teams web | 5e3ce6c0-2b1f-4285-8d4b-75ee78787346 |
+ | Office.com | 4345a7b9-9a63-4910-a426-35363201d503 |
+ | Office.com | 4765445b-32c6-49b0-83e6-1d93765276ca |
+ | Office desktop | 0ec893e0-5785-4de6-99da-4ed124e5296c |
+ | Outlook desktop | d3590ed6-52b3-4102-aeff-aad2292ab01c |
+ | Outlook Web Access | 00000002-0000-0ff1-ce00-000000000000 |
+ | Outlook Web Access | bc59ab01-8403-45c6-8796-ac3ef710b3e3 |
+
### Registers and configures bot For tab app or messaging extension app:
-1. Registers an Azure AD application.
+1. Registers an Azure AD application
-1. Creates a Client Secret for the Azure AD application.
+1. Creates a Client Secret for the Azure AD application
-1. Registers a bot in [Microsoft Bot Framework](https://dev.botframework.com/) using the Azure AD application.
+1. Registers a bot in [Microsoft Bot Framework](https://dev.botframework.com/) using the Azure AD application
-1. Adds Microsoft Teams channel.
+1. Adds Microsoft Teams channel
-1. Configures messaging endpoint as `https://{ngrokTunnelId}.ngrok.io/api/messages`.
+1. Configures messaging endpoint as `https://{ngrokTunnelId}.ngrok.io/api/messages`
### Registers and configures Teams app
-Registers a Teams app in [Developer](https://dev.teams.microsoft.com/home) using the manifest template in `templates/appPackage/manifest.local.template.json`.
+Registers a Teams app in [Developer](https://dev.teams.microsoft.com/home) using the manifest template in `templates/appPackage/manifest.template.json`.
-After registering and configuring the app, local debug files get generated.
+After registering and configuring the app, local debug files generates.
## Take a tour of your app source code
-You can view the project folders and files in the Explorer area of Visual Studio Code after the Teams Toolkit registers and configures your app. The following table lists the local debug files and the configuration types:
+You can view the project folders and files in the Explorer area of VS Code after the Teams Toolkit registers and configures your app. The following table lists the local debug files and the configuration types:
| Folder name| Contents| Debug configuration type | | | | |
-| `.fx/configs/localSettings.json` | Local debug configuration file | The values of each configuration generates and saves during local debug. |
-| `templates/appPackage/manifest.local.template.json` | Teams app manifest template file for local debug | The placeholders in the file resolves during local debug. |
-| `tabs/.env.teams.local` | Environment variables file for tab | The values of each environment variable generates and saves during local debug. |
-| `bot/.env.teamsfx.local` | Environment variables file for bot and messaging extension| The values of each environment variable generates and saves during local debug. |
-| `api/.env.teamsfx.local` | Environment variables file for Azure Functions | The values of each environment variable generates and saves during local debug. |
+| `.fx/configs/config.local.json` | Local debug configuration file | The values of each configuration generate and saves during local debug. |
+| `templates/appPackage/manifest.template.json` | Teams app manifest template file for local debug | The placeholders in the file resolve during local debug. |
+| `tabs/.env.teams.local` | Environment variables file for tab | The values of each environment variable generate and saves during local debug. |
+| `bot/.env.teamsfx.local` | Environment variables file for bot and messaging extension| The values of each environment variable generate and saves during local debug. |
+| `api/.env.teamsfx.local` | Environment variables file for Azure Functions | The values of each environment variable generate and saves during local debug. |
## See also
platform Debug Local https://github.com/MicrosoftDocs/msteams-docs/commits/main/msteams-platform/toolkit/debug-local.md
Complete the following steps to debug your app after creating a new app using th
<details> <summary><b>Windows</b></summary>
-1. Select **Debug Edge** or **Debug Chrome** from the **Run and Debug** in the activity bar.
+1. Select **Debug Edge** or **Debug Chrome** from the **Run and Debug** in the activity bar
:::image type="content" source="../assets/images/teams-toolkit-v2/debug/debug-run.png" alt-text="Browser option" border="false":::
-1. Select **Start Debugging (F5)** or **Run** to run your Teams app in debug mode.
+1. Select **Start Debugging (F5)** or **Run** to run your Teams app in debug mode
:::image type="content" source="../assets/images/teams-toolkit-v2/debug/start-debugging.png" alt-text="Start debugging" border="false":::
-3. Select **Sign in** to Microsoft 365 account.
+3. Select **Sign in** to Microsoft 365 account
:::image type="content" source="../assets/images/teams-toolkit-v2/debug/microsoft365-signin.png" alt-text="Sign in" border="true":::
Complete the following steps to debug your app after creating a new app using th
> [!TIP] > You can select **Read more** to learn about Microsoft 365 Developer Program. Your default web browser opens to let you sign in to your Microsoft 365 account using your credentials.
-4. Select **Install** for installing the development certificate for localhost.
+4. Select **Install** for installing the development certificate for localhost
:::image type="content" source="../assets/images/teams-toolkit-v2/debug/install-certificate.png" alt-text="certificate" border="true"::: > [!TIP] > You can select **Learn More** to know about the development certificate.
-5. Select **Yes** if the following dialog appears:
+5. Select **Yes** if the following dialog box appears:
:::image type="content" source="../assets/images/teams-toolkit-v2/debug/development-certificate.png" alt-text="certification authority" border="true":::
Toolkit launches a new Edge or Chrome browser instance depending on your selecti
<details> <summary><b>macOS</b></summary>
-1. Select **Debug Edge** or **Debug Chrome** from the **Run and Debug** in the activity bar.
+1. Select **Debug Edge** or **Debug Chrome** from the **Run and Debug** in the activity bar
:::image type="content" source="../assets/images/teams-toolkit-v2/debug/debug-run.png" alt-text="Browser lists" border="false":::
-1. Select **Start Debugging (F5)** or **Run** to run your Teams app in debug mode.
+1. Select **Start Debugging (F5)** or **Run** to run your Teams app in debug mode
:::image type="content" source="../assets/images/teams-toolkit-v2/debug/start-debugging.png" alt-text="Debug your app" border="false":::
-3. Select **Sign in** to Microsoft 365 account.
+3. Select **Sign in** to Microsoft 365 account
:::image type="content" source="../assets/images/teams-toolkit-v2/debug/microsoft365-signin.png" alt-text="Sign into M365 account" border="true"::: > [!TIP] > You can select **Read more** to learn about Microsoft 365 Developer Program. Your default web browser opens to let you sign in to your Microsoft 365 account using your credentials.
-4. Select **Install** to install the development certificate for localhost.
+4. Select **Install** to install the development certificate for localhost
:::image type="content" source="../assets/images/teams-toolkit-v2/debug/install-certificate.png" alt-text="certificate" border="true":::
Toolkit launches a new Edge or Chrome browser instance depending on your selecti
</details>
-#### 2. Debug your app
+#### 2. Debug your app
After the initial set up process, the Teams Toolkit starts the following processes:
- a. [Starts app services](#starts-app-services) </br>
- b. [Launches debuggers](#launches-debuggers) </br>
- c. [Sideloads the Teams app](#sideloads-the-teams-app)
+a. [Starts app services](#starts-app-services) </br>
+b. [Launches debuggers](#launches-debuggers) </br>
+ c. [Sideloads the Teams app](#sideloads-the-teams-app)
#### Starts app services
Runs the tasks defined in `.vscode/tasks.json` as follows:
| | | | | Tab | **Start Frontend** | tabs | | Bot or messaging extensions | **Start Bot** | bot |
-| Azure Functions | **Start Backend** | api |
+| Azure Functions | **Start Backend** | API |
The following image displays task names on the **Output** **Terminal** tab of the Visual Studio Code while running tab, bot or messaging extension, and Azure Functions.
Teams Toolkit allows you to customize the debug settings to create your tab or b
<details> <summary><b>Use your bot endpoint</b></summary>
-1. In Visual Studio Code settings, clear **Ensure Ngrok is installed and started (ngrok)**.
+1. In Visual Studio Code settings, clear **Ensure Ngrok is installed and started (ngrok)**
-1. Set botDomain and botEndpoint configuration in `.fx/configs/localSettings.json` to your domain and endpoint.
+1. Set siteEndpoint configuration in `.fx/configs/config.local.json` to your endpoint
+
+```json
+{
+ "bot": {
+ "siteEndpoint": "https://your-bot-tunneling-url"
+ }
+}
+
+```
:::image type="content" source="../assets/images/teams-toolkit-v2/debug/bot-endpoint.png" alt-text="Customize bot endpoint":::
Teams Toolkit allows you to customize the debug settings to create your tab or b
<details> <summary><b>Use your development certificate</b></summary>
-1. In Visual Studio Code settings, clear **Ensure development certificate is trusted (devCert)**.
+1. In Visual Studio Code settings, clear **Ensure development certificate is trusted (devCert)**
+
+1. Set `sslCertFile` and `sslKeyFile` configuration in `.fx/configs/config.local.json` to your certificate file path and key file path
-1. Set sslCertFile and sslKeyFile configuration in `.fx/configs/localSettings.json` to your certificate file path and key file path.
+```json
+{
+ "frontend": {
+ "sslCertFile": "",
+ "sslKeyFile": ""
+ }
+}
+```
:::image type="content" source="../assets/images/teams-toolkit-v2/debug/development-certificate-customize.png" alt-text="Customize certificate":::
Teams Toolkit allows you to customize the debug settings to create your tab or b
<details> <summary><b>Use your start scripts to start app services</b></summary>
-1. For tab, update `dev:teamsfx` script in `tabs/package.json`.
+1. For tab, update `dev:teamsfx` script in `tabs/package.json`
-1. For bot or messaging extension, update `dev:teamsfx` script in `bot/package.json`.
+1. For bot or messaging extension, update `dev:teamsfx` script in `bot/package.json`
-1. For Azure Functions, update `dev:teamsfx` script in `api/package.json` and for TypeScript update `watch:teamsfx` script.
+1. For Azure Functions, update `dev:teamsfx` script in `api/package.json` and for TypeScript update `watch:teamsfx` script
> [!NOTE] > Currently, the tab, bot, messaging extension apps, and Azure Functions ports don't support customization.
platform Whats New https://github.com/MicrosoftDocs/msteams-docs/commits/main/msteams-platform/whats-new.md
Microsoft Teams platform features that are available to all app developers.
| **Date** | **Update** | **Find here** | | -- | | -|
+|04/26/2022|Uninstall behavior for personal app with bot | Build bots > Bot conversations > [Uninstall behavior updates in personal apps with bots](bots/how-to/conversations/subscribe-to-conversation-events.md#uninstall-behavior-for-personal-app-with-bot)|
|04/22/2022| Test preview for monetized apps | Monetize your app > [Test preview for monetized apps](concepts/deploy-and-publish/appsource/prepare/test-preview-for-monetized-apps.md) |04/22/2022| In-app purchase flow for monetization of apps | Monetize your app > [In-app purchases](concepts/deploy-and-publish/appsource/prepare/in-app-purchase-flow.md) |04/20/2022 | Set up CI/CD pipelines | Tools and SDKs > Teams Toolkit for Visual Studio Code > [Set up CI/CD pipelines](toolkit/use-CICD-template.md)|
Developer preview is a public program that provides early access to unreleased T
|02/02/2022| Introduced app manifest version 1.12 | App manifest > Public developer preview > [Manifest schema](resources/schem) | |01/17/2022| People Picker in Adaptive cards for mobile | Build cards and task modules > Build cards > [People Picker in Adaptive Cards](task-modules-and-cards/cards/people-picker.md)| |01/10/2022 | Teams Toolkit for Visual Studio Code | Tools and SDKs > Teams Toolkit for Visual Studio Code > [Teams Toolkit fundamentals](toolkit/teams-toolkit-fundamentals.md) |
-|12/24/2021| Introduced step-by-step guide to grant Tab device permissions | App fundamentals > Device capabilities > [step-by-step guide to grant Tab device permissions](sbs-tab-device-permissions.yml) |
|11/15/2021| Personal tabs and messaging extensions run in Outlook and Office | [Extend Teams apps across Microsoft 365](~/m365-apps/overview.md) | |10/28/2021|Bots can be enabled to receive all channel messages using resource-specific consent (RSC) | ΓÇó Build bots > Bot conversations > Messages in bot conversations > [Receive all messages with RSC](~/bots/how-to/conversations/channel-messages-with-rsc.md) </br> ΓÇó Build bots > Bot conversations > [bot conversation overview](~/bots/how-to/conversations/conversation-basics.md) </br> ΓÇó Build bots > Bot conversations > [channel and group conversations](~/bots/how-to/conversations/channel-and-group-conversations.md) </br> ΓÇó App manifest > Public developer preview > [developer preview manifest schema](~/resources/schem) |
-|06/21/2021|Uninstall behavior for personal app with bot | Build bots > Bot conversations > [Uninstall behavior updates in personal apps with bots](bots/how-to/conversations/subscribe-to-conversation-events.md#uninstall-behavior-for-personal-app-with-bot)|
|06/16/2021| Resource-specific consent for chats | ΓÇó Utilize Teams data with Microsoft Graph > [Resource-specific consent](graph-api/rsc/resource-specific-consent.md) </br> ΓÇó Test your app > Microsoft Graph > [Test resource-specific consent permissions in Teams](graph-api/rsc/test-resource-specific-consent.md)| For more information, see [public developer preview for Teams](~/resources/dev-preview/developer-preview-intro.md).