Updates from: 09/08/2022 03:21:00
Service Microsoft Docs article Related commit history on GitHub Change details
platform Add Authentication https://github.com/MicrosoftDocs/msteams-docs/commits/main/msteams-platform/bots/how-to/authentication/add-authentication.md
The Azure Bot resource registration registers your web service as a bot with the
1. Select your **Resource group** from the dropdown list. 1. Select **Type of App** as **Multi Tenant** for **Microsoft App ID**.
- ![Multi Tenant](~/assets/images/adaptive-cards/multi-tenant.png)
+ :::image type="content" source="../../../assets/images/adaptive-cards/multi-tenant.png" alt-text="This screenshot shows how to select multi tenant for Microsoft AppID.":::
1. Select **Review + create**.
- ![Create Azure Bot](~/assets/images/adaptive-cards/create-azure-bot.png)
+ :::image type="content" source="../../../assets/images/adaptive-cards/create-azure-bot.png" alt-text="This screenshot show how to create Azure bot.":::
1. If the validation passes, select **Create**. It takes a few moments for your bot service to be provisioned.
- ![Azure Bot validation](~/assets/images/adaptive-cards/validation-pane.png)
+ :::image type="content" source="../../../assets/images/adaptive-cards/validation-pane.png" alt-text="This screenshot show how Azure bot validation passes.":::
1. Select **Go to resource**. The bot and the related resources are listed in the resource group.
- ![Go to resource](~/assets/images/adaptive-cards/go-to-resource-card.png)
+ :::image type="content" source="../../../assets/images/adaptive-cards/go-to-resource-card.png" alt-text="This screenshot shows how to select resources group.":::
Now your Azure bot is created.
- ![Azure bot resource created](~/assets/images/adaptive-cards/azure-bot-ui.png)
+ :::image type="content" source="../../../assets/images/adaptive-cards/azure-bot-ui.png" alt-text="This screenshot shows how to create Azure bot resources.":::
To create client secret: 1. In **Settings**, select **Configuration**. Save the **Microsoft App ID** (client ID) for future reference.
- ![Microsoft App ID](~/assets/images/adaptive-cards/config-microsoft-app-id.png)
+ :::image type="content" source="../../../assets/images/adaptive-cards/config-microsoft-app-id.png" alt-text="This screenshot shows how to add Microsoft App ID to create client secret.":::
1. Next to **Microsoft App ID**, select **Manage**.
- :::image type="content" source="~/assets/images/manage-bot-label.png" alt-text="manage bot":::
+ :::image type="content" source="~/assets/images/manage-bot-label.png" alt-text="This screenshot shows how to create manage bot.":::
1. In the **Client secrets** section, select **New client secret**.**Add a client secret** window appears.
- ![New Client secret](~/assets/images/meetings-side-panel/newclientsecret.png)
+ :::image type="content" source="../../../assets/images/meetings-side-panel/newclientsecret.PNG" alt-text="This screenshot shows how to create new client secret.":::
1. Enter **Description** and select **Add**.
- ![Client secret](~/assets/images/adaptive-cards/client-secret.png)
+ :::image type="content" source="../../../assets/images/adaptive-cards/client-secret.png" alt-text="The screenshot shows how to enter description for the client secret.":::
1. In the **Value** column, select **Copy to clipboard** and save the client secret ID for future reference.
- ![Client secret value](~/assets/images/adaptive-cards/client-secret-value.png)
+ :::image type="content" source="../../../assets/images/adaptive-cards/client-secret-value.png" alt-text="The screenshot shows how to save the client secret ID for future reference.":::
To add the Microsoft Teams channel: 1. Go to **Home**.
- ![Bot home page](~/assets/images/adaptive-cards/bot-home-page.png)
+ :::image type="content" source="../../../assets/images/adaptive-cards/bot-home-page.png" alt-text="This screenshot shows you the bot home page.":::
1. Open your bot, which is listed in the **Recent resources** section. 1. Select **Channels** in the left pane and select **Microsoft Teams** :::image type="icon" source="../../../assets/icons/teams-icon.png":::.
- :::image type="content" source="../../../assets/images/adaptive-cards/channel-teams.png" alt-text="Select Teams in channels":::
+ :::image type="content" source="../../../assets/images/adaptive-cards/channel-teams.png" alt-text="This screenshot shows how to select Teams in channels.":::
1. Select the checkbox to accept the terms of service and select **Agree**.</br>
- ![Select terms of service](~/assets/images/adaptive-cards/select-terms-of-service.png)
+ :::image type="content" source="../../../assets/images/adaptive-cards/select-terms-of-service.png" alt-text="This screenshot shows how to set the terms if service.":::
1. Select **Save**.
- ![Select Teams](~/assets/images/adaptive-cards/select-teams.png)
+ :::image type="content" source="../../../assets/images/adaptive-cards/select-teams.png" alt-text="This screenshot shows how to add Microsoft Teams channel.":::
For more information, see [Create a bot for Teams](../create-a-bot-for-teams.md).
Note-there are two options for Service Providers here- Azure AD V1 and Azure AD
1. Select your bot registration link. 1. Open the resource page and select **Configuration** under **Settings**. 1. Select **Add OAuth Connection Settings**.
-The following image displays the corresponding selection in the resource page:
-![SampleAppDemoBot configuration](~/assets/images/authentication/sample-app-demo-bot-configuration.png)
+ The following image displays the corresponding selection in the resource page:
+
+ ![SampleAppDemoBot configuration](~/assets/images/authentication/sample-app-demo-bot-configuration.png)
+ 1. Complete the form as follows: 1. **Name**. Enter a name for the connection. You'll use this name in your bot in the `appsettings.json` file. For example, *BotTeamsAuthADv1*.
The following image displays the corresponding selection in the resource page:
h. For **Resource URL**, enter `https://graph.microsoft.com/`. This isn't used in the current code sample. i. Leave **Scopes** blank. The following image is an example:
- ![teams bots app auth connection string adv1 view](../../../assets/images/authentication/auth-bot-identity-connection-adv1.png)
+ :::image type="content" source="../../../assets/images/authentication/auth-bot-identity-connection-adv1.PNG" alt-text="This screenshot shows how to add Teams bot auth bot identity connection adv1.":::
1. Select **Save**.
The following image displays the corresponding selection in the resource page:
1. In the [**Azure portal**][azure-portal], select your Azure Bot from the dashboard. 1. In the resource page, select **Configuration** under **Settings**. 1. Select **Add OAuth Connection Settings**.
-The following image displays the corresponding selection in the resource page:
-![SampleAppDemoBot Configuration](~/assets/images/authentication/sample-app-demo-bot-configuration.png)
+ The following image displays the corresponding selection in the resource page:
+
+ :::image type="content" source="../../../assets/images/authentication/sample-app-demo-bot-configuration.png" alt-text="This screenshot shows the corresponding selection in the resource page.":::
1. Complete the form as follows:
The following image displays the corresponding selection in the resource page:
1. The first time you do this will open a new browser window asking you to select an account. Select the one you want to use. 1. Next, you'll be asked to allow to the identity provider to use your data (credentials). The following image is an example:
- ![teams bot auth connection string adv1](../../../assets/images/authentication/auth-bot-connection-test-accept.PNG)
+ :::image type="content" source="../../../assets/images/authentication/auth-bot-connection-test-accept.PNG" alt-text="The screenshot shows how to add Teams bot auth connection string adv1.":::
1. Select **Accept**. 1. This should then redirect you to a **Test Connection to \<your-connection-name> Succeeded** page. Refresh the page if you get an error. The following image is an example:
- ![teams bots app auth connection str adv1](../../../assets/images/authentication/auth-bot-connection-test-token.PNG)
+ :::image type="content" source="../../../assets/images/authentication/auth-bot-connection-test-token.PNG" alt-text="The screenshot shows how to add Teams app auth connection string adv1.":::
The connection name is used by the bot code to retrieve user authentication tokens.
Alternatively, while in Visual Studio, you can follow these steps:
1. Select the **Publish** button. 1. In the next dialog window, enter the required information. The following is an example:
- ![auth-app-service](../../../assets/images/authentication/auth-bot-app-service.png)
+ :::image type="content" source="../../../assets/images/authentication/auth-bot-app-service.png" alt-text="This screenshot shows how to enter required information for auth app service.":::
1. Select **Create**. 1. If the deployment completes successfully, you should see it reflected in Visual Studio. Moreover, a page is displayed in your default browser saying *Your bot is ready!*. The URL will be similar to this: `https://botteamsauth.azurewebsites.net/`. Save it to a file. 1. In your browser, navigate to the [**Azure portal**][azure-portal]. 1. Check your resource group, the bot should be listed along with the other resources. The following image is an example:
- ![teams-bot-auth-app-service-group](../../../assets/images/authentication/auth-bot-app-service-in-group.png)
+ :::image type="content" source="../../../assets/images/authentication/auth-bot-app-service-in-group.png" alt-text="This screenshot shows how to check resource group and bot.":::
1. In the resource group, select the bot registration name (link). 1. In the left panel, select **Settings**.
After you've configured the authentication mechanism, you can perform the actual
The following image is an example of the bot UI after you've logged in:
- ![auth bot login emulator](../../../assets/images/authentication/auth-bot-login-emulator.PNG)
+ :::image type="content" source="../../../assets/images/authentication/auth-bot-login-emulator.PNG" alt-text="This screenshot shows an example of the bot UI after you've logged in.":::
1. If you select **Yes** when the bot asks *Would you like to view your token?* you'll get a response similar to the following:
- ![auth bot login emulator token](../../../assets/images/authentication/auth-bot-login-emulator-token.png)
+ :::image type="content" source="../../../assets/images/authentication/auth-bot-login-emulator-token.png" alt-text="This screenshot shows how to select the consent.":::
1. Enter **logout** in the input chat box to sign out. This releases the user token, and the bot won't be able to act on your behalf until you sign in again.
and when for these, and just reference that from here, along with the set of ste
1. If asked, select the applicable user's account. The following image is an example of the bot UI after you've logged in:
- ![auth bot login deployed](../../../assets/images/authentication/auth-bot-login-deployed.PNG).
+ :::image type="content" source="../../../assets/images/authentication/auth-bot-login-deployed.PNG" alt-text="This screenshot shows an example of the Teams bot UI after you've logged in.":::
1. Select the **Yes** button to display your authentication token. The following image is an example:
- ![auth bot login deployed token](../../../assets/images/authentication/auth-bot-login-deployed-token.PNG).
+ :::image type="content" source="../../../assets/images/authentication/auth-bot-login-deployed-token.PNG" alt-text="This screenshot shows how to select Yes button to display your authentication token.":::
1. Enter logout to sign out.
- ![auth bot deployed logout](../../../assets/images/authentication/auth-bot-deployed-logout.PNG)
+ :::image type="content" source="../../../assets/images/authentication/auth-bot-deployed-logout.PNG" alt-text="This screenshot shows how to enter logout to sign out.":::
> [!NOTE] > If you're having problems signing in, try to test the connection again as described in the previous steps. This could recreate the authentication token.
and when for these, and just reference that from here, along with the set of ste
1. Navigate to the `TeamsAppManifest` folder and upload the zipped manifest. The following wizard is displayed:
- ![auth bot teams upload](../../../assets/images/authentication/auth-bot-teams-upload.png)
+ :::image type="content" source="../../../assets/images/authentication/auth-bot-teams-upload.png" alt-text="This screenshot shows an example of the bot after it is uploaded into Teams.":::
1. Select the **Add to a team** button. 1. In the next window, select the team where you want to use the bot.
To set up ngrok in preparation for running your Teams app locally, follow these
1. Run, for example, `ngrok http 3978 --host-header=localhost:3978`. Replace the port number as needed. This launches ngrok to listen on the port you specify. In return, it gives you an externally addressable URL, valid for as long as ngrok is running. The following image is an example:
- ![teams bot app auth connection string adv1](../../../assets/images/authentication/auth-bot-ngrok-start.PNG).
+ :::image type="content" source="../../../assets/images/authentication/auth-bot-ngrok-start.PNG" alt-text="This screenshot shows the Teams bot app auth connection string adv1":::
1. Copy the forwarding HTTPS address. It should be similar to the following: `https://dea822bf.ngrok.io/`. 1. Append `/api/messages` to obtain `https://dea822bf.ngrok.io/api/messages`. This is the **messages endpoint** for the bot running locally on your machine and reachable over the web in a chat in Teams.
This launches ngrok to listen on the port you specify. In return, it gives you a
1. Test the bot while running locally using the Bot Framework portal's **Test Web chat**. Like the Emulator, this test doesn't allow you to access Teams-specific functionality. 1. In the terminal window where `ngrok` is running you can see HTTP traffic between the bot and the web chat client. If you want a more detailed view, in a browser window enter `http://127.0.0.1:4040` you obtained from the previous terminal window. The following image is an example:
- ![auth bot teams ngrok testing](../../../assets/images/authentication/auth-bot-teams-ngrok-testing.png).
+ :::image type="content" source="../../../assets/images/authentication/auth-bot-teams-ngrok-testing.png" alt-text="This screenshot shows auth bot teams ngrok testing.":::
> [!NOTE] > If you stop and restart ngrok, the URL changes. To use ngrok in your project, and depending on the capabilities you're using, you must update all URL references.
This section provides Bot authentication v3 SDK sample.
[teams-auth-bot-py]: https://github.com/microsoft/BotBuilder-Samples/tree/master/samples/python/46.teams-auth [teams-auth-bot-js]: https://github.com/microsoft/BotBuilder-Samples/tree/master/samples/javascript_nodejs/46.teams-auth-
-[azure-aad-blade]: https://ms.portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/Overview
-[aad-registration-blade]: https://ms.portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/RegisteredAppsPreview
platform Subscribe To Conversation Events https://github.com/MicrosoftDocs/msteams-docs/commits/main/msteams-platform/bots/how-to/conversations/subscribe-to-conversation-events.md
A member removed event is sent to your bot in the following scenarios:
The member removed activity `eventType` is set to `teamMemberRemoved` when the event is sent from a team context. To determine if the new member removed was the bot itself or a user, check the `Activity` object of the `turnContext`. If the `MembersRemoved` list contains an object where `id` is the same as the `id` field of the `Recipient` object, then the member added is the bot, else it's a user. The bot's id is formatted as `28:<MicrosoftAppId>`. - > [!NOTE] > When a user is permanently deleted from a tenant, `membersRemoved conversationUpdate` event is triggered.
The `channelData` object in the following payload example is based on adding a m
} ``` - # [Python](#tab/python) ```python
In this example, the `conversation.id` of the `conversationUpdate` and `installa
# [C#](#tab/dotnet) ```csharp
-protected override async Task
-OnInstallationUpdateActivityAsync(ITurnContext<IInstallationUpdateActivity> turnContext, CancellationToken cancellationToken) {
-var activity = turnContext.Activity; if
-(string.Equals(activity.Action, "Add",
-StringComparison.InvariantCultureIgnoreCase)) {
-// TO:DO Installation workflow }
-else
-{ // TO:DO Uninstallation workflow
-} return; }
+protected override async Task OnInstallationUpdateActivityAsync(ITurnContext<IInstallationUpdateActivity> turnContext, CancellationToken cancellationToken)
+{
+ var activity = turnContext.Activity;
+ if (string.Equals(activity.Action, "Add", StringComparison.InvariantCultureIgnoreCase))
+ {
+ // TO:DO Installation workflow
+ }
+ else
+ {
+ // TO:DO Uninstallation workflow
+ }
+ return;
+}
``` You can also use a dedicated handler for *add* or *remove* scenarios as an alternative method to capture an event. ```csharp
-protected override async Task
-OnInstallationUpdateAddAsync(ITurnContext<IInstallationUpdateActivity>
-turnContext, CancellationToken cancellationToken) {
-// TO:DO Installation workflow return;
+protected override async Task OnInstallationUpdateAddAsync(ITurnContext<IInstallationUpdateActivity> turnContext, CancellationToken cancellationToken)
+{
+ // TO:DO Installation workflow return;
} ```
platform Shared Channels https://github.com/MicrosoftDocs/msteams-docs/commits/main/msteams-platform/concepts/build-and-test/shared-channels.md
Apps must function cross-tenants in installation and usage. The following table
* [Build tabs for Teams](../../tabs/what-are-tabs.md) * [App manifest schema for Teams](../../resources/schem)
+* [Shared channels in Microsoft Teams](/MicrosoftTeams/shared-channels)
+* [Retention policy for Teams locations](/microsoft-365/compliance/create-retention-policies)
platform Glossary https://github.com/MicrosoftDocs/msteams-docs/commits/main/msteams-platform/get-started/glossary.md
Common terms and definitions used in Teams developer documentation.
| Deploy | A process to upload the backend and frontend code for the application. At Deployment, the code for your app is copied to the resources you created during provisioning. <br>**See also**: [Provision](#p) | | [Device capabilities](../concepts/device-capabilities/device-capabilities-overview.md) | Built-in devices, such as camera, microphone, barcode scanner, photo gallery, in a mobile or desktop. You can access the following device capabilities on mobile or desktop through dedicated APIs available in Microsoft Teams JavaScript client SDK. <br>**See also**: [Capability](#c); [Media capability](#m); [Location capability](#l) | | [Device permission](../concepts/device-capabilities/browser-device-permissions.md) | A Teams app setting that you can configure in your app. You use it to request permission for your app to access and utilize a native device capability. You can manage device permissions in Teams settings. <br>**See also**: [App permissions](#a) |
-| [Dev environment](../toolkit/teamsfx-multi-env.md#create-a-new-environment) | A type of development environment that Teams Toolkit creates by default. It represents remote or cloud environment configurations. A project can have multiple remote environments. You can add more dev environments to your project using Teams Toolkit. <br>**See also** [Environment](#e); [Local environment](#l) |
+| [Dev environment](../toolkit/TeamsFx-multi-env.md#create-new-environment) | A type of development environment that Teams Toolkit creates by default. It represents remote or cloud environment configurations. A project can have multiple remote environments. You can add more dev environments to your project using Teams Toolkit. <br>**See also** [Environment](#e); [Local environment](#l) |
| [DevTools](../tabs/how-to/developer-tools.md) | Browser's DevTools are used to view console logs, view or modify runtime network requests, add breakpoints to code (JavaScript) and perform interactive debugging for a Teams app. The feature is only available for desktop and Android clients after the Developer Preview has been enabled. | | [Dynamic search](../task-modules-and-cards/cards/dynamic-search.md#dynamic-typeahead-search) | A search feature for Adaptive Cards that is useful to search and select data from large data sets. It helps to filter out the choices as the user enters the search string. <br>**See also**: [Static search](#s) |
Common terms and definitions used in Teams developer documentation.
| Term | Definition | | | | | [Link unfurling](../messaging-extensions/how-to/link-unfurling.md) | A feature used with message extension and meeting to unfold links pasted into a compose message area. The links expand to show additional information about the link in Adaptive Cards or in the meeting stage view. |
-| [Local environment](../toolkit/teamsfx-multi-env.md#create-a-new-environment) | A default development environment created by Teams Toolkit. <br>**See also**: [Environment](#e); [Dev environment](#d) |
+| [Local environment](../toolkit/TeamsFx-multi-env.md#create-new-environment) | A default development environment created by Teams Toolkit. <br>**See also**: [Environment](#e); [Dev environment](#d) |
| [Local workbench](../sbs-gs-spfx.yml) | The default option to run and debug a Teams app in Visual Studio Code that is created using SPFx. <br>**See also**: [Workbench](#w); [Teams workbench](#t) | | [Location capability](../concepts/device-capabilities/location-capability.md) | A device capability that you can integrate with your app to know the geographical location of the app user for an enhanced collaborative experience. This feature is currently available only for Teams mobile clients only. <br>**See also**: [Capability](#c); [Media capability](#m); [Device Capability](#d); [Teams Mobile](#t) | | [Low code apps](../samples/teams-low-code-solutions.md) | A custom Teams app built from scratch using Microsoft Power Platform that requires little or no coding, and can be developed and deployed quickly. |
platform Install Collaboration Control https://github.com/MicrosoftDocs/msteams-docs/commits/main/msteams-platform/samples/install-collaboration-control.md
For more information on role privileges, see [Configure user security in an envi
## Install the Collaboration controls solutions
-You'll install the Collaboration controls into your dataverse environment via a private link. This link must not be shared with any other person inside or outside your organization.
+You'll install the Collaboration controls into your dataverse environment via [Microsoft AppSource.](https://appsource.microsoft.com/en-us/product/dynamics-365/mscm.collaboration-toolkit-preview?flightCodes=collaborationcontrols&signInModalType=2&ctaType=1)
-You'll be able to configure and use the components within your own model-driven app only after receiving the link and installing Collaboration controls into your dataverse environment.
+
+You'll be able to configure and use the components within your own model-driven app only after browsing to [Microsoft AppSource](https://appsource.microsoft.com/en-us/product/dynamics-365/mscm.collaboration-toolkit-preview?flightCodes=collaborationcontrols&signInModalType=2&ctaType=1) and installing Collaboration controls into your dataverse environment.
Collaboration Controls include the following solutions:
Collaboration Controls include the following solutions:
Before installation, you must be in a Power Platform environment or admin tenant. You'll need a dataverse environment with a database. If you don't have one, you'll need to [create a new one](/power-platform/admin/create-environment) to continue with the installation.
-To install the solutions, begin by browsing to [Microsoft AppSource] and then complete the following steps:
+To install the solutions, browse to [Microsoft AppSource](https://appsource.microsoft.com/en-us/product/dynamics-365/mscm.collaboration-toolkit-preview?flightCodes=collaborationcontrols&signInModalType=2&ctaType=1) and complete the following steps:
1. Select **Get it now** button.
platform AAD Manifest Customization https://github.com/MicrosoftDocs/msteams-docs/commits/main/msteams-platform/toolkit/AAD-manifest-customization.md
Title: Manage Azure Active Directory application in Teams Toolkit
+ Title: Edit Azure Active Directory manifest in Teams Toolkit
description: Describes Managing Azure Active Directory application in Teams Toolkit
Last updated 05/20/2022
-# Customize Azure AD manifest
+# Edit Azure AD manifest
-The [Azure Active Directory (Azure AD) manifest](/azure/active-directory/develop/reference-app-manifest) contains definitions of all the attributes of an Azure AD application object in the Microsoft identity platform.
+The [Azure Active Directory (Azure AD) manifest](/azure/active-directory/develop/reference-app-manifest) contain definitions of all the attributes of an Azure AD application object in the Microsoft identity platform.
-Teams Toolkit now manages Azure AD application with the manifest file as the source of truth during your Teams application development lifecycles.
+Teams Toolkit now manages Azure AD application with the manifest file as the source of truth during your Teams application development lifecycle.
+
+This section covers:
+
+* [Customize Azure AD manifest template](#customize-azure-ad-manifest-template)
+* [Azure AD manifest template placeholders](#azure-ad-manifest-template-placeholders)
+* [Author and preview Azure AD manifest with code lens](#author-and-preview-azure-ad-manifest-with-code-lens)
+* [Deploy Azure AD application changes for local environment](#deploy-azure-ad-application-changes-for-local-environment)
+* [Deploy Azure AD application changes for remote environment](#deploy-azure-ad-application-changes-for-remote-environment)
+* [View Azure AD application on the Azure portal](#view-azure-ad-application-on-the-azure-portal)
+* [Use an existing Azure AD application](#use-an-existing-azure-ad-application)
+* [Azure AD application in Teams application development lifecycle](#azure-ad-application-in-teams-application-development-lifecycle)
## Customize Azure AD manifest template
You can customize Azure AD manifest template to update Azure AD application.
2. Update the template directly or [reference values from another file](https://github.com/OfficeDev/TeamsFx/wiki/Manage-AAD-application-in-Teams-Toolkit#Placeholders-in-AAD-manifest-template). You can see several customization scenarios here:
- * [Add an application permission](#customize-requiredresourceaccess)
- * [Preauthorize a client application](#customize-preauthorizedapplications)
- * [Update redirect URL for authentication response](#customize-redirect-urls)
+ * [Add an application permission](#add-an-application-permission)
+ * [Preauthorize a client application](#preauthorize-a-client-application)
+ * [Update redirect URL for authentication response](#update-redirect-url-for-authentication-response)
3. [Deploy Azure AD application changes for local environment](#deploy-azure-ad-application-changes-for-local-environment). 4. [Deploy Azure AD application changes for remote environment](#deploy-azure-ad-application-changes-for-remote-environment).
-### Customize requiredResourceAccess
+### Add an application permission
If the Teams application requires more permissions to call API with additional permissions, you need to update `requiredResourceAccess` property in the Azure AD manifest template. You can see the following example for this property:
If the Teams application requires more permissions to call API with additional p
] ```
-* `resourceAppId` property is for different APIs, for `Microsoft Graph` and `Office 365` `SharePoint Online`, enter the name directly instead of UUID, and for other APIs, use UUID.
+* `resourceAppId` property is used for different APIs. For `Microsoft Graph` and `Office 365` `SharePoint Online`, enter the name directly instead of UUID, and for other APIs, use UUID.
-* `resourceAccess.id` property is for different permissions, for `Microsoft Graph` and `Office 365 SharePoint Online`, enter the permission name directly instead of UUID, and for other APIs, use UUID.
+* `resourceAccess.id` property is used for different permissions. For `Microsoft Graph` and `Office 365 SharePoint Online`, enter the permission name directly instead of UUID, and for other APIs, use UUID.
* `resourceAccess.type` property is used for delegated permission or application permission. `Scope` means delegated permission and `Role` means application permission.
-### Customize preAuthorizedApplications
+### Preauthorize a client application
-You can use `preAuthorizedApplications` property to authorize a client application to indicate that the API trusts the application and users don't consent when the client calls it exposed API. You can see the following example for this property:
+You can use `preAuthorizedApplications` property to authorize a client application to indicate that the API trusts the application. Users don't consent when the client calls it exposed API. You can see the following example for this property:
```JSON
You can use `preAuthorizedApplications` property to authorize a client applicati
] ```
-`preAuthorizedApplications.appId` property is used for the application you want to authorize. If you don't know the application ID but only knows the application name, you can go to Azure portal and follow the steps to search the application to find the ID :
+`preAuthorizedApplications.appId` property is used for the application you want to authorize. If you don't know the application ID and know only the application name, use the following steps to search application ID:
-1. Go to [Azure portal](https://portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/RegisteredApps) and open application registrations.
+1. Go to [Azure portal](https://portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/RegisteredApps) and open **Application Registrations**.
1. Select **All applications** and search for the application name. 1. Select the application name and get the application ID from the overview page.
-### Customize redirect URLs
+### Update redirect URL for authentication response
- Redirect URLs are used while returning authentication responses such as tokens after successful authentication. You can customize redirect URLs using property `replyUrlsWithType`, for example, to add `https://www.examples.com/auth-end.html` as redirect URL, you can add it as the following example:
+ Redirect URLs are used while returning authentication responses such as tokens after successful authentication. You can customize redirect URLs using property `replyUrlsWithType`. For example, to add `https://www.examples.com/auth-end.html` as redirect URL, you can add it as the following example:
``` JSON "replyUrlsWithType": [
The Azure AD manifest file contains placeholder arguments with {{...}} statement
### Reference state file values in Azure AD manifest template
-The State file is located in `.fx\states\state.xxx.json` (xxx represents different environment). The following example shows typical state file:
+The state file is located in `.fx\states\state.xxx.json` (xxx represents different environment). The following example shows typical state file:
``` JSON {
The State file is located in `.fx\states\state.xxx.json` (xxx represents differe
} ```
-You can use this placeholder argument in the Azure AD manifest: `{{state.fx-resource-aad-app-for-teams.applicationIdUris}}` to refer `applicationIdUris` value in `fx-resource-aad-app-for-teams` property.
+You can use this placeholder argument in the Azure AD manifest: `{{state.fx-resource-aad-app-for-teams.applicationIdUris}}` to point out `applicationIdUris` value in `fx-resource-aad-app-for-teams` property.
### Reference config file values in Azure AD manifest template
-The Config file is located in `.fx\configs\config.xxx.json` (xxx represents different environment). The following example shows config file:
+The config file is located in `.fx\configs\config.xxx.json` (xxx represents different environment). The following example shows config file:
``` JSON {
Azure AD manifest template file has code lens to review and edit.
### Azure AD manifest template file
-At the beginning of the Azure AD manifest template file, there's a preview code lens. Select the code lens, it generates Azure AD manifest based on the environment you selected.
+There's a preview code lens at the beginning of the Azure AD manifest template file. Select the code lens to generate an Azure AD manifest based on your selected environment.
:::image type="content" source="../assets/images/teams-toolkit-v2/manual/add codelens.png" alt-text="addcodelens":::
Placeholder argument code lens helps you to take quick look of the values for lo
### Required resource access code lens
-It's different from official [Azure AD manifest schema](/azure/active-directory/develop/reference-app-manifest) that `resourceAppId` and `resourceAccess` ID in `requiredResourceAccess` property only supports UUID, Azure AD manifest template in Teams Toolkit also supports user readable strings for `Microsoft Graph` and `Office 365 SharePoint Online` permissions. If you enter UUID, code lens shows user readable strings, otherwise, it shows UUID.
+It's different from official [Azure AD manifest schema](/azure/active-directory/develop/reference-app-manifest) that `resourceAppId` and `resourceAccess` ID in `requiredResourceAccess` property only supports UUID. Azure AD manifest template in Teams Toolkit also supports user readable strings for `Microsoft Graph` and `Office 365 SharePoint Online` permissions. If you enter UUID, code lens shows user readable strings, otherwise, it shows UUID.
:::image type="content" source="../assets/images/teams-toolkit-v2/manual/add resource.png" alt-text="addresource"::: ### Pre-authorized applications code lens
-Code lens shows the application name for the per-authorized application ID for the `preAuthorizedApplications` property.
+Code lens shows the application name for the pre-authorized application ID for the `preAuthorizedApplications` property.
## Deploy Azure AD application changes for local environment
Code lens shows the application name for the per-authorized application ID for t
:::image type="content" source="../assets/images/teams-toolkit-v2/manual/add deploy1.png" alt-text="deploy1":::
-2. Select `local` environment.
+2. Select **local** environment.
:::image type="content" source="../assets/images/teams-toolkit-v2/manual/add deploy2.png" alt-text="deploy2":::
Code lens shows the application name for the per-authorized application ID for t
## View Azure AD application on the Azure portal
-1. Copy the Azure AD application client ID from `state.xxx.json` (xxx is the environment name that you have deployed the Azure AD application) file in the `fx-resource-aad-app-for-teams` property.
+1. Copy the Azure AD application client ID from `state.xxx.json` () file in the `fx-resource-aad-app-for-teams` property.
:::image type="content" source="../assets/images/teams-toolkit-v2/manual/add view1.png" alt-text="view1":::
-2. Go to [Azure portal](https://ms.portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/RegisteredApps) and log-in to Microsoft 365 account.
+ > [!NOTE]
+ > xxx in the client ID indicates the environment name where you have deployed the Azure AD application
+
+2. Go to [Azure portal](https://ms.portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/RegisteredApps) and sign in to Microsoft 365 account.
> [!NOTE] > Ensure that login credentials of Teams application and M365 account are same.
-3. Open [app registrations page](https://ms.portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/RegisteredApps), search the Azure AD application using client ID that you copied before.
+3. Open [App Registrations page](https://ms.portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/RegisteredApps), search the Azure AD application using client ID that you copied before.
:::image type="content" source="../assets/images/teams-toolkit-v2/manual/add view2.png" alt-text="view2"::: 4. Select Azure AD application from search result to view the detail information.
-5. In Azure AD app information page, select `Manifest` menu to view manifest of this application. The schema of the manifest is same as the one in `aad.template.json` file. For more information about manifest, see [Azure Active Directory application manifest](/azure/active-directory/develop/reference-app-manifest).
+5. In Azure AD app information page, select the `Manifest` menu to view manifest of this application. The schema of the manifest is same as the one in `aad.template.json` file. For more information about manifest, see [Azure Active Directory application manifest](/azure/active-directory/develop/reference-app-manifest).
:::image type="content" source="../assets/images/teams-toolkit-v2/manual/add view3.png" alt-text="view3":::
You need to interact with Azure AD application during various stages of your Tea
1. **To create Project**
- You can create a project with Teams Toolkit that comes with SSO support by default such as `SSO-enabled tab`. For more information to create a new app, see [create new Teams application using Teams Toolkit](create-new-project.md). An Azure AD manifest file is automatically created for you: `templates\appPackage\aad.template.json`. Teams Toolkit creates or updates the Azure AD application during local development or while you move the application to the cloud.
+ You can create a project with Teams Toolkit that comes with SSO support by default such as `SSO-enabled tab`. For more information on create a new app, see [create new Teams application using Teams Toolkit](create-new-project.md). An Azure AD manifest file is automatically created for you in `templates\appPackage\aad.template.json`. Teams Toolkit creates or updates the Azure AD application during local development or while you move the application to the cloud.
2. **To add SSO to your Bot or Tab**
- After you create a Teams application without SSO built-in, Teams Toolkit incrementally helps you to add SSO for the project. As a result, An Azure AD manifest file is automatically created for you: `templates\appPackage\aad.template.json`.
+ After you create a Teams application without SSO built-in, Teams Toolkit incrementally helps you to add SSO for the project. As a result, an Azure AD manifest file is automatically created for you in `templates\appPackage\aad.template.json`.
Teams Toolkit creates or updates the Azure AD application during next local debug session or while you move the application to the cloud. 3. **To build Locally**
- Teams Toolkit performs the following functions during local development (known as F5):
+ Teams Toolkit performs the following functions during local development or it's known as F5:
- * Read the `state.local.json` file to find an existing Azure AD application. If an Azure AD application already exists, Teams Toolkit re-uses the existing Azure AD application otherwise you need to create a new application using the `aad.template.json` file.
+ * Read the `state.local.json` file to find an existing Azure AD application. If an Azure AD application already exists, Teams Toolkit reuses the existing Azure AD application. Otherwise you need to create a new application using the `aad.template.json` file.
- * Initially ignores some properties in the manifest file that requires additional context (such as replyUrls property that requires a local debug endpoint) during the creation of a new Azure AD application with the manifest file.
+ * Initially ignores some properties in the manifest file that requires more context, (such as replyUrls property that requires a local debug endpoint) during the creation of a new Azure AD application with the manifest file.
- * After the local dev environment startup successfully, the Azure AD application's identifierUris, replyUrls, and other properties that are not available during creation stage are updated accordingly.
+ * After the local dev environment startup successfully, the Azure AD application's identifierUris, replyUrls, and other properties that aren't available during creation stage are updated accordingly.
- * The changes you have done to your Azure AD application are loaded during next local debug session. You can see [Azure AD application changes](https://github.com/OfficeDev/TeamsFx/wiki/) to apply changes manually Azure AD application changes.
+ * The changes you've done to your Azure AD application are loaded during next local debug session. You can see [Azure AD application changes](https://github.com/OfficeDev/TeamsFx/wiki/) to apply changes manually Azure AD application changes.
4. **To provision for cloud resources** You need to provision cloud resources and deploy your application while moving your application to the cloud. At the stages, like local development, Teams Toolkit will:
- * Read the `state.{env}.json` file to find an existing Azure AD application. If an Azure AD application already exists, Teams Toolkit re-uses the existing Azure AD application otherwise you need to create a new application using the `aad.template.json` file.
+ * Read the `state.{env}.json` file to find an existing Azure AD application. If an Azure AD application already exists, Teams Toolkit re-uses the existing Azure AD application. Otherwise you need to create a new application using the `aad.template.json` file.
- * Initially ignores some properties in the manifest file that requires additional context (such as replyUrls property requires frontend or bot endpoint) during the creation of a new Azure AD application with the manifest file.
+ * Initially ignores some properties in the manifest file that requires more context (such as replyUrls property requires frontend or bot endpoint) during the creation of a new Azure AD application with the manifest file.
* After other resources provision completes, the Azure AD application's identifierUris and replyUrls are updated accordingly to the correct endpoints.
platform Integrate With Developer Portal https://github.com/MicrosoftDocs/msteams-docs/commits/main/msteams-platform/toolkit/Integrate-with-developer-portal.md
+
+ Title: Integrate with Developer Portal in Teams Toolkit
+
+description: In this module, learn how to integrate with Developer Portal in Teams Toolkit
+
+ms.localizationpriority: medium
+ Last updated : 07/29/2022++
+# Integrate with Developer Portal
+
+You can configure and manage your app in developer portal within Teams Toolkit.
+
+## To Publish app using Developer Portal
+
+The following steps help you to publish your app in Developer Portal:
+
+1. Select **Developer Portal for Teams** under **DEPLOYMENT**.
+
+ :::image type="content" source="../assets/images/teams-toolkit-v2/teams toolkit fundamentals/dev-portal-ttk.png" alt-text="Developer Portal for Teams":::
+
+ Now Developer Portal opens in a browser.
+
+1. Sign-in to [Developer portal for Teams](https://dev.teams.microsoft.com) using the corresponding account.
+1. Import your app package in zip, select **App** > **Import app**.
+1. Select **Publish** > **Publish to your org**.
+
+## To update Manifest file and app package
+
+If there are any changes related to Teams app's manifest file, you can update the manifest and publish the Teams app again. To publish Teams app manually, you may leverage [Developer Portal for Teams](https://dev.teams.microsoft.com/home).
+
+1. Sign-in to [Developer portal for Teams](https://dev.teams.microsoft.com) using the corresponding account.
+1. Import your app package in zip, select **App** > **Import app**.<br>
+ You need to replace the app, that you previously uploaded to the Developer Portal.
+1. To publish your app, select **Publish** > **Publish to your org**.
+
+You can do the following configuration in the Developer Portal:
+
+* **Basic information**: This section shows and allows you to edit the App name, App ID, Descriptions, Version, Developer Information, App URLs, Application (client) ID, and Microsoft Partner Network ID.
+* **Branding**: This page shows the app icon details.
+* **App features**: You can add the following features to your app:
+ * Personal app
+ * Bot
+ * Connector
+ * Scene
+ * Group and channel app
+ * Messaging extension
+ * Meeting extension
+ * Activity feed notification
+* **Permissions**: This section allows you to give Device permissions, Team permissions, Chat or Meeting permissions, and User Permissions for your app.
+* **Single sign-on**: You can configure your app to authenticate users with single sign-on (SSO).
+* **Languages**: You can set up or change the language of your app.
+* **Domain**: You can add the domains to load your apps in the Teams client (For example: *.example.com).
+
+## See also
+
+* [Developer Portal for Teams](../concepts/build-and-test/teams-developer-portal.md)
+* [Manage your apps in Developer Portal](../concepts/build-and-test/manage-your-apps-in-developer-portal.md)
platform Teamsfx SDK https://github.com/MicrosoftDocs/msteams-docs/commits/main/msteams-platform/toolkit/TeamsFx-SDK.md
Title: TeamsFx SDK-+ description: In this module, learn about TeamsFx SDK, core concepts and code structure, advanced Customization and scenarios-+ ms.localizationpriority: medium Last updated 11/29/2021
Last updated 11/29/2021
# TeamsFx SDK
-TeamsFx helps to reduce the developer tasks by using 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:
+TeamsFx helps to reduce your tasks by using Microsoft Teams Single-Sign-On (Teams SSO) and accessing cloud resources down to single line statements with zero configuration. You can use TeamsFx SDK in browser and Node.js environment. TeamsFx core functionalities can be accessed in client as well as server environment. You can write user authentication code in a simplified way for:
-* Teams tab application
-* Azure Function
+* Teams tab
* Teams bot-
-You can use the TeamsFx SDK to:
-
-* Access the core functionalities in client and server environment.
-* Write user authentication code in a simplified way.
+* Azure Function
## Prerequisites
-Install the following tools and set up your development environment:
+You need to install the following tools and set up your development environment:
-* 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).
+| &nbsp; | Install | For using... |
+ | | | |
+ | &nbsp; | [Visual Studio Code](https://code.visualstudio.com/download) | JavaScript, TypeScript, or SharePoint Framework (SPFx) build environments. Use version 1.55 or later. |
+ | &nbsp; | [Teams Toolkit](https://marketplace.visualstudio.com/items?itemName=TeamsDevApp.ms-teams-vscode-extension)| A Microsoft Visual Studio Code extension that creates a project scaffolding for your app. Use 4.0.0 version. |
+ | &nbsp; | [Node.js](https://nodejs.org/en/download/) | Back-end JavaScript runtime environment. Use the latest v16 LTS release.|
+ | &nbsp; | [Microsoft Teams](https://www.microsoft.com/microsoft-teams/download-app) | Microsoft Teams to collaborate with everyone you work with through apps for chat, meetings, call - all in one place.|
+ | &nbsp; | [Microsoft&nbsp;Edge](https://www.microsoft.com/edge) (recommended) or [Google Chrome](https://www.google.com/chrome/) | A browser with developer tools. |
-You must have working knowledge of the following:
+> [!NOTE]
+> If your project has installed `botbuilder` related [packages](https://github.com/Microsoft/botbuilder-js#packages) as dependencies, ensure they are of the same version.
+
+You must have working knowledge of:
* [Source code](https://github.com/OfficeDev/TeamsFx/tree/main/packages/sdk) * [Package (NPM)](https://www.npmjs.com/package/@microsoft/teamsfx)
Install the TeamsFx SDK for TypeScript or JavaScript with `npm`:
npm install @microsoft/teamsfx ```
-### Create `MicrosoftGraphClient` service
-
-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.
-
-<br>
-
-<details>
-<summary><b>Invoke Graph API on behalf of Teams User (User Identity)</b></summary>
-
-Use the following snippet:
-
-```ts
-// 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
-```
-
-</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
-// 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 core functionalities
### TeamsFx class
TeamsFx class instance access all TeamsFx settings from environment variables by
When creating a TeamsFx instance, you also need to specify the identity type. There are two identity types:
-* User Identity
-* Application Identity
+* **User Identity**: Represents the current user of Teams.
+* **Application Identity**: Represents the application itself.
-#### User Identity
+ > [!NOTE]
+ > For these two identity types, the TeamsFx constructors and methods aren't the same.
+
+You can learn more about user identity and application identity in the following section:
+
+<details>
+<summary><b> User identity </b></summary>
| Command | Description | |-|-|
There are two identity types:
> [!NOTE] > You can access resources on behalf of current Teams user.
+</details>
-#### Application Identity
+<details>
+<summary><b> Application identity </b></summary>
| Command | Description | |-|-|
There are two identity types:
> [!NOTE] > You need admin consent for resources.
+</details>
### Credential
-You must choose identity type when initializing TeamsFx. After you've 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 rely on credential call `TeamsFx:getCredential()` to get an instance of `TokenCredential`.
+To initialize TeamsFx, you must choose the required identity type. Post specifying the identity type SDK uses different type of credential class. These help represent the identity and get access token by corresponding auth flow. Credential classes implement `TokenCredential` interface that is broadly used in Azure library APIs designed to provide access tokens for specific scopes. Other APIs rely on credential call `TeamsFx:getCredential()` to get an instance of `TokenCredential`. For more information on credential and auth flow related classes, see [credential folder](https://github.com/OfficeDev/TeamsFx/tree/main/packages/sdk/src/credential).
-Here's the corresponding scenarios for each credential class target.
+There are three credential classes to simplify authentication. Here's the corresponding scenarios for each credential class target.
-#### User Identity in browser environment
+<details>
+<summary><b> User Identity in browser environment </b></summary>
-`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 developers choose user identity in browser environment.
+`TeamsUserCredential` represents Teams current user's identity. For the first time user's credentials are authenticated, then Teams SSO does the On-Behalf-Of flow for token exchange. SDK uses this credential when you choose user identity in browser environment.
-Required configuration: `initiateLoginEndpoint`, `clientId`.
+The required configurations are: `initiateLoginEndpoint` and `clientId`.
+</details>
-#### User Identity in Node.js environment
+<details>
+<summary><b> User Identity in Node.js environment </b></summary>
-`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 developers choose user identity in Node.js environment.
+`OnBehalfOfUserCredential` uses On-Behalf-Of flow and require Teams SSO token, in Azure function or bot scenarios. TeamsFx SDK uses the following credential when you choose user identity in Node.js environment.
Required configuration: `authorityHost`, `tenantId`, `clientId`, `clientSecret` or `certificateContent`.
+</details>
-#### Application Identity in Node.js environment
+<details>
+<summary><b> App Identity in Node.js environment </b></summary>
-`AppCredential` represents the application identity. It's used when user isn't involved like time-triggered automation job. SDK uses this credential when developers choose App identity in Node.js environment.
+`AppCredential` represents the app identity. You can use app identity when user isn't involved, for example in a time-triggered automation job. TeamsFx SDK uses the following credential when you choose app identity in Node.js environment.
Required configuration: `tenantId`, `clientId`, `clientSecret` or `certificateContent`.
+</details>
### Bot SSO Bot related classes are stored under [bot folder](https://github.com/OfficeDev/TeamsFx/tree/main/packages/sdk/src/bot).
-`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.
+`TeamsBotSsoPrompt` integrates with bot framework. It simplifies the authentication process when you develop bot application and want to use the bot SSO.
Required configuration: `initiateLoginEndpoint`, `tenantId`, `clientId`, and `applicationIdUri`.
TeamsFx SDK provides several functions to ease the configuration for third-party
Required configuration:
-* `sqlServerEndpoint`, `sqlUsername`, `sqlPassword` if you want to use user identity.
-* `sqlServerEndpoint`, `sqlIdentityId` if you want to use MSI identity.
+* If you want to use user identity then `sqlServerEndpoint`, `sqlUsername` and `sqlPassword` are required.
+* If you want to use MSI identity then `sqlServerEndpoint`and `sqlIdentityId` are required.
-### Error handling
+### Override configuration
-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 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;
- }
-}
-```
-
-If credential instance is used in other library such as Microsoft Graph, it's possible that error is caught and transformed.
-
-```ts
-try {
- 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
- if (err instanceof GraphError && err.code?.includes(ErrorCode.UiRequiredError)) {
- this.setState({
- showLoginBtn: true,
- });
- }
-}
-```
-
-## Scenarios
-
-The following section provides several code snippets for common scenarios:
-
-<br>
+You can pass custom config when creating a new `TeamsFx` instance to override default configuration or set required fields when `environment variables` are missing.
<details>
-<summary><b>Use Graph API in tab app</b></summary>
+<summary><b>
+For tab project
+</b> </summary>
-Use `TeamsFx` and `createMicrosoftGraphClient`.
+If you've created tab project using Microsoft Visual Studio Code Toolkit, the following config values will be used from pre-configured environment variables:
-```ts
-const teamsfx = new TeamsFx();
-const graphClient = createMicrosoftGraphClient(teamsfx, ["User.Read"]);
-const profile = await graphClient.api("/me").get();
-```
+* 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) // only used when there's a backend function
+* apiName (REACT_APP_FUNC_NAME) // only used when there's a backend function
</details>
-<br>
- <details>
-<summary><b>Create API client to call existing API in Bot or Azure Function</b></summary>
-
+<summary><b>
+For Azure function or bot project
+</b></summary>
+
+If you've created Azure function or bot project using Visual Studio 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) // only used when there's a sql instance
+* sqlUsername (SQL_USER_NAME) // only used when there's a sql instance
+* sqlPassword (SQL_PASSWORD) // only used when there's a sql instance
+* sqlDatabaseName (SQL_DATABASE_NAME) // only used when there's a sql instance
+* sqlIdentityId (IDENTITY_ID) // only used when there's a sql instance
</details>
-<br>
-
-<details>
-<summary><b>Call Azure Function in tab app</b></summary>
+### Error handling
-Use `axios` library to make HTTP request to Azure Function.
+Basic type of 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
-const teamsfx = new TeamsFx();
-const credential = teamsfx.getCredential(); //Create an API Client that uses SSO token to authenticate requests
-const apiClient = CreateApiClient(teamsfx.getConfig("apiEndpoint")),
-new BearerTokenAuthProvider(async () => (await credential.getToken(""))!.token);// Call API hosted in Azure Functions on behalf of user
-const response = await apiClient.get("/api/" + functionName);
+try {
+ 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;
+ }
+}
```
-</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()`.
+If credential instance is used in other library such as Microsoft Graph, it's possible that error is caught and transformed.
-```ts
-// 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 getTediousConnectionConfig(teamsfx);
-// If there are multiple SQL databases
-const config2 = await getTediousConnectionConfig(teamsfx "your database name");
-const connection = new Connection(config);
-connection.on("connect", (error) => {
- if (error) {
- console.log(error);
- }
-});
-```
+## Microsoft Graph Scenarios
-</details>
+This section provides several code snippets for common scenarios that are related to Microsoft Graph. In such scenarios, user can call APIs using different permissions in different ends(frontend/backend).
-<br>
+* User delegate permission in frontend (Use TeamsUserCredential)
+ <details>
+ <summary><b>Use graph API in tab app</b></summary>
-<details>
-<summary><b>Use certificate-based authentication in Azure Function</b></summary>
+ This code snippet shows you how to use `TeamsFx` and `createMicrosoftGraphClient` to get user profiles from Microsoft Graph. It also shows you how to catch and resolve a `GraphError`.
-```ts
-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();
-```
+ 1. Import the classes needed.
-</details>
+ ```ts
+ import {
+ createMicrosoftGraphClient,
+ TeamsFx,
+ } from "@microsoft/teamsfx";
+ ```
-<br>
+ 2. Use `TeamsFx.login()` to get user consent.
-<details>
-<summary><b>Use Graph API in bot application</b></summary>
+ ```ts
+ // Put these code in a call-to-action callback function to avoid browser blocking automatically showing up pop-ups.
+ await teamsfx.login(["User.Read"]); // Login with scope
+ ```
-Add `TeamsBotSsoPrompt` to dialog set.
+ 3. You can initialize a TeamsFx instance and graph client and get information from MS Graph by this client.
-```ts
-const { ConversationState, MemoryStorage } = require("botbuilder");
-const { DialogSet, WaterfallDialog } = require("botbuilder-dialogs");
-const { TeamsBotSsoPrompt } = require("@microsoft/teamsfx");
-
-const convoState = new ConversationState(new MemoryStorage());
-const dialogState = convoState.createProperty("dialogState");
-const dialogs = new DialogSet(dialogState);
-
-const teamsfx = new TeamsFx();
-dialogs.add(
- new TeamsBotSsoPrompt(teamsfx, "TeamsBotSsoPrompt", {
- scopes: ["User.Read"],
- })
-);
-
-dialogs.add(
- new WaterfallDialog("taskNeedingLogin", [
- async (step) => {
- return await step.beginDialog("TeamsBotSsoPrompt");
- },
- async (step) => {
- const token = step.result;
- if (token) {
- // ... continue with task needing access token ...
- } else {
- await step.context.sendActivity(`Sorry... We couldn't log you in. Try again later.`);
- return await step.endDialog();
+ ```ts
+ try {
+ 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
+ if (err instanceof GraphError && err.code?.includes(ErrorCode.UiRequiredError)) {
+ // Need to show login button to ask for user consent.
}
- },
- ])
-);
-```
+ }
+ ```
-</details>
+ For more information on sample to use Graph API in tab app, see the [hello-world-tab sample](https://github.com/OfficeDev/TeamsFx-Samples/tree/dev/hello-world-tab).
-<br>
+ </details>
-<details>
-<summary><b>Integration with Microsoft Graph Toolkit</b></summary>
+ <details>
+ <summary><b>Integration with Microsoft Graph Toolkit</b></summary>
-The [Microsoft Graph Toolkit (mgt)](https://aka.ms/mgt) library is a collection of various authentication providers and UI components powered by Microsoft Graph.
+ The [Microsoft Graph Toolkit (mgt)](https://aka.ms/mgt) library is a collection of various authentication providers and UI components powered by Microsoft Graph.
-The `@microsoft/mgt-teamsfx-provider` package exposes the `TeamsFxProvider` class, which uses `TeamsFx` class to sign in users and acquire tokens to use with Graph.
+ The `@microsoft/mgt-teamsfx-provider` package exposes the `TeamsFxProvider` class that uses `TeamsFx` class to sign in users and acquire tokens to use with Graph.
-1. Install the required packages.
+ 1. You can install the following required packages:
```bash npm install @microsoft/mgt-element @microsoft/mgt-teamsfx-provider @microsoft/teamsfx ```
-2. Initialize the provider inside your component.
+ 2. Initialize the provider inside your component.
```ts // Import the providers and credential at the top of the page
The `@microsoft/mgt-teamsfx-provider` package exposes the `TeamsFxProvider` clas
Providers.globalProvider = provider; ```
-3. Use the `teamsfx.login(scopes)` method to get required access token.
+ 3. You can use the `teamsfx.login(scopes)` method to get required access token.
```ts // Put these code in a call-to-action callback function to avoid browser blocking automatically showing up pop-ups.
The `@microsoft/mgt-teamsfx-provider` package exposes the `TeamsFxProvider` clas
Providers.globalProvider.setState(ProviderState.SignedIn); ```
-4. Now, you can add any component in your HTML page or in your `render()` method with React to use the `TeamsFx` context to access Microsoft Graph.
+ 4. You can now add any component in your HTML page or in your `render()` method with React to use the `TeamsFx` context to access Microsoft Graph.
```html <mgt-person query="me" view="threeLines"></mgt-person>
The `@microsoft/mgt-teamsfx-provider` package exposes the `TeamsFxProvider` clas
} ```
-For more information on sample to initialize the TeamsFx provider, see the [Contacts Exporter sample](https://github.com/OfficeDev/TeamsFx-Samples/tree/dev/hello-world-tab-with-backend).
+ For more information on sample to initialize the TeamsFx provider, see the [Contacts Exporter sample](https://github.com/OfficeDev/TeamsFx-Samples/tree/dev/graph-toolkit-contact-exporter).
-</details>
+ </details>
+
+* User delegate permission in backend (Use OnBehalfOfUserCredential)
+ <details>
+ <summary><b>Use Graph API in bot Application</b></summary>
+
+ This code snippet shows you how to use `TeamsBotSsoPrompt` to set a dialog and then sign-in to get an access token.
+
+ 1. Initialize and add `TeamsBotSsoPrompt` to dialog set.
+
+ ```ts
+ const { ConversationState, MemoryStorage } = require("botbuilder");
+ const { DialogSet, WaterfallDialog } = require("botbuilder-dialogs");
+ const { TeamsBotSsoPrompt } = require("@microsoft/teamsfx");
+
+ const convoState = new ConversationState(new MemoryStorage());
+ const dialogState = convoState.createProperty("dialogState");
+ const dialogs = new DialogSet(dialogState);
+
+ const teamsfx = new TeamsFx();
+ dialogs.add(
+ new TeamsBotSsoPrompt(teamsfx, "TeamsBotSsoPrompt", {
+ scopes: ["User.Read"],
+ })
+ );
+ ```
+
+ 2. Begin the dialog and sign-in.
+
+ ```ts
+ dialogs.add(
+ new WaterfallDialog("taskNeedingLogin", [
+ async (step) => {
+ return await step.beginDialog("TeamsBotSsoPrompt");
+ },
+ async (step) => {
+ const token = step.result;
+ if (token) {
+ // ... continue with task needing access token ...
+ } else {
+ await step.context.sendActivity(`Sorry... We couldn't log you in. Try again later.`);
+ return await step.endDialog();
+ }
+ },
+ ])
+ );
+ ```
+
+ For more information on sample to use graph API in bot application, see [bot-sso sample](https://github.com/OfficeDev/TeamsFx-Samples/tree/dev/bot-sso).
+
+ </details>
+
+ <details>
+ <summary><b>Call Azure Function in tab app: On-Behalf-Of flow</b></summary>
+
+ This code snippet shows you how to use `CreateApiClient` or `axios` library to call Azure Function, and how to call Graph API in Azure function to get user profiles.
+
+ 1. You can use `CreateApiClient` provided by TeamsFx sdk to call Azure Function:
+
+ ```ts
+ async function callFunction(teamsfx?: TeamsFx) {
+ const teamsfx = new TeamsFx();
+
+ // Get the credential.
+ const credential = teamsfx.getCredential();
+ // Create an API client by providing the token and endpoint.
+ const apiClient = CreateApiClient(
+ teamsfx.getConfig("YOUR_API_ENDPOINT"), // Create an API Client that uses SSO token to authenticate requests
+ new BearerTokenAuthProvider(async () => (await credential.getToken(""))!.token) // Call API hosted in Azure Functions on behalf of user to inject token to request header
+ );
+
+ // Send a GET request to "RELATIVE_API_PATH", "/api/functionName" for example.
+ const response = await apiClient.get("RELATIVE_API_PATH");
+ return response.data;
+ }
+ ```
+
+ You can also use `axios` library to call Azure Function.
+
+ ```ts
+ async function callFunction(teamsfx?: TeamsFx) {
+ const accessToken = await teamsfx.getCredential().getToken(""); // Get SSO token
+ // teamsfx.getConfig("apiEndpoint") will read REACT_APP_FUNC_ENDPOINT environment variable
+ const endpoint = teamsfx.getConfig("apiEndpoint");
+ const response = await axios.default.get(endpoint + "/api/" + functionName, {
+ headers: {
+ authorization: "Bearer " + accessToken.token,
+ },
+ });
+ return response.data;
+ }
+ ```
+
+ 2. Call Graph API in Azure function on-behalf of user in response.
+
+ ```ts
+ export default async function run(
+ context: Context,
+ req: HttpRequest,
+ teamsfxContext: TeamsfxContext
+ ): Promise<Response> {
+ const res: Response = { status: 200, body: {},};
+ // ...
+ teamsfx = new TeamsFx().setSsoToken(accessToken);
+ // Query user's information from the access token.
+ try {
+ const currentUser: UserInfo = await teamsfx.getUserInfo();
+ if (currentUser && currentUser.displayName) {
+ res.body.userInfoMessage = `User display name is ${currentUser.displayName}.`;
+ } else {
+ res.body.userInfoMessage = "No user information was found in access token.";
+ }
+ } catch (e) {
+ }
+ // Create a graph client to access user's Microsoft 365 data after user has consented.
+ try {
+ const graphClient: Client = createMicrosoftGraphClient(teamsfx, [".default"]);
+ const profile: any = await graphClient.api("/me").get();
+ res.body.graphClientMessage = profile;
+ } catch (e) {
+ }
+ return res;
+ }
+ ```
-<br>
+ For more information on sample to use graph API in bot application, see [hello-world-tab-with-backend sample](https://github.com/OfficeDev/TeamsFx-Samples/tree/dev/hello-world-tab-with-backend).
+
+ </details>
+
+* Application permission in backend
+ <details>
+ <summary><b>Use certificate-based authentication in Azure Function</b></summary>
+
+ This code snippet shows you how to use certificate-based application permission to get the token that can be used to call Graph API.
+
+ 1. You can initialize the `authConfig` by providing a `PEM-encoded key certificate`.
+
+ ```ts
+ 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,
+ };
+ ```
+
+ 2. You can use the `authConfig` to get the token.
+
+ ```ts
+ const teamsfx = new TeamsFx(IdentityType.App);
+ teamsfx.setCustomeConfig(authConfig);
+ const token = teamsfx.getCredential().getToken();
+ ```
+
+ </details>
+
+ <details>
+ <summary><b>Use client secret authentication in Azure Function</b></summary>
+
+ This code snippet shows you how to use client secret application permission to get the token that can be used to call Graph API.
+
+ 1. You can initialize the `authConfig` by providing a `client secret`.
+
+ ```ts
+ const authConfig = {
+ clientId: process.env.M365_CLIENT_ID,
+ clientSecret: process.env.M365_CLIENT_SECRET,
+ authorityHost: process.env.M365_AUTHORITY_HOST,
+ tenantId: process.env.M365_TENANT_ID,
+ };
+ ```
+
+ 2. You can use the `authConfig` to get the token.
+
+ ```ts
+ const teamsfx = new TeamsFx(IdentityType.App);
+ teamsfx.setCustomeConfig(authConfig);
+ const token = teamsfx.getCredential().getToken();
+ ```
+
+ For more information on sample to use graph API in bot application, see the [hello-world-tab-with-backend sample](https://github.com/OfficeDev/TeamsFx-Samples/tree/dev/hello-world-tab-with-backend).
+
+ </details>
+
+## Other scenarios
+
+This section provides several code snippets for other scenarios that are related to Microsoft Graph. You can create API client in Bot or Azure Function and access SQL database in Azure Function.
+
+ <details>
+ <summary><b>Create API client to call existing API in Bot or Azure Function</b></summary>
+
+ This code snippet shows you how to call an existing API in Bot by `ApiKeyProvider`.
+
+ ```ts
+ const teamsfx = new TeamsFx();
+
+ // Create an API Key auth provider. In addition to APiKeyProvider, following auth providers are also available:
+ // BearerTokenAuthProvider, BasicAuthProvider, CertificateAuthProvider.
+ const authProvider = new ApiKeyProvider("YOUR_API_KEY_NAME",
+ teamsfx.getConfig("YOUR_API_KEY_VALUE"), // This reads the value of YOUR_API_KEY_VALUE environment variable.
+ ApiKeyLocation.Header
+ );
+
+ // Create an API client using above auth provider.
+ // You can also implement AuthProvider interface and use it here.
+ const apiClient = createApiClient(
+ teamsfx.getConfig("YOUR_API_ENDPOINT"), // This reads YOUR_API_ENDPOINT environment variable.
+ authProvider
+ );
+
+ // Send a GET request to "RELATIVE_API_PATH", "/api/apiname" for example.
+ const response = await apiClient.get("RELATIVE_API_PATH");
+ ```
+
+ </details>
+
+ <details>
+ <summary><b>Access SQL database in Azure Function</b></summary>
+
+ Use `tedious` library to access SQL and use `DefaultTediousConnectionConfiguration` that manages authentication. You can also compose connection config of other SQL libraries based on the result of `sqlConnectionConfig.getConfig()`.
+
+ 1. Set the connection configuration.
+
+ ```ts
+ // 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 getTediousConnectionConfig(teamsfx);
+ // If there are multiple SQL databases
+ const config2 = await getTediousConnectionConfig(teamsfx, "your database name");
+ ```
+
+ 2. Connect to your database.
+
+ ```ts
+ const connection = new Connection(config);
+ connection.on("connect", (error) => {
+ if (error) {
+ console.log(error);
+ }
+ });
+ ```
+
+ > [!NOTE]
+ > For more information on sample to access SQL database in Azure function, see [share-now sample](https://github.com/OfficeDev/TeamsFx-Samples/tree/dev/share-now).
+
+</details>
## Advanced Customization ### Configure log
-You can set customer log level and redirect outputs when using this library. Logging is turned off by default, you can turn it on by setting log level.
+You can set customer log level and redirect outputs when using this library.
+
+> [!NOTE]
+> Logging is turned off by default, you can turn it on by setting log level.
#### Enable log by setting log level
-Logging is enabled only when you set log level. By default, it prints log information to console.
+When you set log level then Logging gets enabled. It prints log information to console by default.
Set log level using the following snippet:
Set log level using the following snippet:
setLogLevel(LogLevel.Warn); ```
-You can redirect log output by setting custom logger or log function.
+> [!NOTE]
+> You can redirect log output by setting custom logger or log function.
#### Redirect by setting custom logger
setLogger(context.log);
#### Redirect by setting custom log function
-> [!NOTE]
-> Log function will not take effect, if you set a custom logger.
- ```ts setLogLevel(LogLevel.Info); // Only log error message to Application Insights in bot application.
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)
+> [!NOTE]
+> Log functions don't take effect if you set a custom logger.
## Upgrade latest SDK version
-If you're using the version of SDK that has `loadConfiguration()`, you can follow these steps to upgrade to the latest SDK version.
+If you're 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).
+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.
## Next step
-[Samples](https://github.com/OfficeDev/TeamsFx-Samples) project for detailed examples on how to use TeamsFx SDK.
+For detailed examples on how to use TeamsFx SDK [Samples](https://github.com/OfficeDev/TeamsFx-Samples) project.
## See also
platform Teamsfx Collaboration https://github.com/MicrosoftDocs/msteams-docs/commits/main/msteams-platform/toolkit/TeamsFx-collaboration.md
Title: Collaborate on TeamsFx Project using Teams Toolkit-+ description: In this article, learn how to collaborate on TeamsFx Project using Teams Toolkit and collaborate with other developers.-+ ms.localizationpriority: medium Last updated 11/29/2021
-# Collaborate on Teams project using Teams Toolkit
+# Collaborate on Teams project using Microsoft Teams Toolkit
-Multiple developers can work together to debug, provision and deploy for the same TeamsFx project, but it requires manually setting the right permissions of Teams App and Microsoft Azure Active Directory (Azure AD) App. Teams Toolkit supports collaboration feature to allow developers and project owner to invite other developers or collaborators to the TeamsFx project to debug, provision, and deploy the same TeamsFx project.
-
-## Prerequisites
-
-* Microsoft 365 subscription.
-* Azure with valid subscription.
-
- For more information on different accounts, see [prepare accounts to build Teams app](accounts.md).
-
-* [Install Teams Toolkit](https://marketplace.visualstudio.com/items?itemName=TeamsDevApp.ms-teams-vscode-extension) version v3.0.0+
-
-> [!TIP]
-> Ensure you have a Teams app project opened in Visual Studio Code.
+Multiple developers can work together to debug, provision and deploy for the same TeamsFx project, but it requires manually setting the right permissions of Teams App and Microsoft Azure Active Directory (Azure AD). Teams Toolkit supports collaboration feature to allow developers and project owner to invite other developers or collaborators to the TeamsFx project to debug, provision, and deploy the same TeamsFx project.
## Collaborate with other developers
-The following lists guide us to understand the collaboration process and its limitation:
+The following sections guide us to understand the collaboration process as project owner or collaborator:
-* As project owner
+### As project owner
> [!NOTE] > Before adding collaborators for an environment, project owner needs to [provision](provision.md) the project first.
- 1. In **ENVIRONMENT** section on Teams Toolkit, select **collaborators**. It displays the options **Add Microsoft 365 Teams App (with Azure AD App) Owners** and **List Microsoft 365 Teams App (with Azure AD App) Owners** as shown in the following images:
+ 1. Select **Teams Toolkit** in the activity bar.
+
+ :::image type="content" source="../assets/images/teams-toolkit-v2/teams toolkit fundamentals/select-teams-toolkit.png" alt-text="Select teams toolkit from activity bar":::
+
+ 1. In **ENVIRONMENT** section, select collaborators, that displays as option **1** **Add Microsoft 365 Teams App (with Azure AD App) Owners** and **2** **List Microsoft 365 Teams App (with Azure AD App) Owners** as shown in the following image:
:::image type="content" source="../assets/images/teams-toolkit-v2/teams toolkit fundamentals/add collaborators.png" alt-text="collaborators"::: 2. Select **Add Microsoft 365 Teams App (with Azure AD App) Owners** and add other Microsoft 365 account email address as collaborator. The account to be added must be on the same tenant as project owner for remote debug as shown in the image:
- :::image type="content" source="../assets/images/teams-toolkit-v2/teams toolkit fundamentals/manifest preview-1.png" alt-text="add envi":::
+ :::image type="content" source="../assets/images/teams-toolkit-v2/teams toolkit fundamentals/add-owner.png" alt-text="Add project owner":::
- 3. To view collaborators in current environment, select **List Microsoft 365 Teams App (with Azure AD App) Owners**, then collaborators are listed in the output channel as shown in following image:
+ 3. To view collaborators in current environment, select **List Microsoft 365 Teams App (with Azure AD App) Owners**, then you can see collaborators listed in the output channel as shown in following image:
:::image type="content" source="../assets/images/teams-toolkit-v2/teams toolkit fundamentals/list of collaborators.png" alt-text="list":::
- 4. Push the project to GitHub
+ 4. Push the project to GitHub.
> [!NOTE] > The newly added collaborators do not receive any notification. The Project owner needs to notify collaborator.
-* As project collaborator
+### As project collaborator
1. Clone the project from GitHub. 2. Log on to Microsoft 365 account.
The following lists guide us to understand the collaboration process and its lim
> [!NOTE] > Collaborators must log in using the account that project owner adds under the same tenant with project owner. For more information, see [build and run your Teams app in remote environment](/microsoftteams/platform/sbs-gs-javascript?tabs=vscode%2Cvsc%2Cviscode%2Cvcode&tutorial-step=3&branch).
-### Limitations
+## Remove Collaborators
If you want to remove collaborators from Teams Toolkit extension, you need to remove manually as you can't remove them directly. Perform the following steps to remove collaborators manually:
If you want to remove collaborators from Teams Toolkit extension, you need to re
* Select **Owners** from left panel in Azure AD App management page. * Select and remove the collaborator.
- > [!NOTE]
- >
- > * Collaborator added to your project doesn't receive any notification. Project owner needs to notify collaborator offline.
- > * Azure related permissions must be set manually by Azure subscription administrator on Azure portal. Azure account must have contributor role for the subscription so that developers can work together to provision, and deploy TeamsFx project.
+ > [!NOTE]
+ >
+ > * Collaborator added to your project doesn't receive any notification. Project owner needs to notify collaborator offline.
+ > * Azure related permissions must be set manually by Azure subscription administrator on Azure portal.
+ > * Azure account must have contributor role for the subscription so that developers can work together to provision, and deploy TeamsFx project.
## See also
platform Teamsfx Multi Env https://github.com/MicrosoftDocs/msteams-docs/commits/main/msteams-platform/toolkit/TeamsFx-multi-env.md
Title: TeamsFX multiple environments in Teams Toolkit-
+ Title: TeamsFX multiple environments in Teams Toolkit
+ description: In this module, learn about TeamsFX multi environment such as, create a new environment, select target environment and more-+ ms.localizationpriority: medium Last updated 11/29/2021
Last updated 11/29/2021
# 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.
+ Microsoft Teams Toolkit provides a simple way for you to create and manage multiple environments, provision, and deploy artifacts to the target environment for your Microsoft Teams App.
- You can perform the following with the multiple environments:
+ You can perform the following with multiple environments:
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 up different behaviors for multiple environments such as enable telemetry in production environment, however disable it in development environment.
+2. **Manage app behaviors in different environments**: You can set up different app behaviors for multiple environments such as enable telemetry in production environment.
-## Prerequisite
+ > [!NOTE]
+ > Ensure that telemetry is disabled in development environment.
-* 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.
-> [!TIP]
-> Ensure you have Teams app project opened in Visual Studio code.
+## Create new environment
-## Create a new environment
+After you create a project, Teams Toolkit by default configures:
-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 configuration.
+* One `dev` environment to represent the remote or cloud environment configuration.
> [!NOTE] > Each project can have only one `local` environment but multiple remote environments.
-**To add another remote environment**:
+**Add remote environment**:
-1. Select the **Teams** :::image type="content" source="~/assets/images/teams-toolkit-v2/teams-toolkit-sidebar-icon.png" alt-text="sso add sidebar"::: from left navigation bar.
-2. Select **+Teams: Create new environment** under the **Environment** section as shown in the following image:
+1. Select the **Teams Toolkit** :::image type="content" source="~/assets/images/teams-toolkit-v2/teams-toolkit-sidebar-icon.png" alt-text="From the activity bar"::: from the activity bar.
+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":::
+ :::image type="content" source="../assets/images/teams-toolkit-v2/teams toolkit fundamentals/create new env.png" alt-text="create new environment":::
- 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.
+> [!Note]
+> If you have more than one environments, then 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've selected to the new environment created.
-## Select target environment
+## 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, Teams Toolkit prompts you to select a target environment when you have multiple remote environments:
:::image type="content" source="../assets/images/teams-toolkit-v2/teams toolkit fundamentals/manifest preview-1.png" alt-text="add env"::: ## Project folder structure
-After creating the project, you can view the project folders and files under **Explorer** in VS Code. Besides the custom codes, Teams Toolkit uses some files to maintain the config, state, and template of the app. The following list provides files and outlines their relationship with multiple environments.
+After creating the project, you can view the project folders and files under **Explorer** in Visual Studio Code. Besides the custom codes, Teams Toolkit uses some files to maintain the `configs`, `states`, and `templates` 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.
+* `.fx/configs`: Configures the files that user can customize for Teams app.
* `config.<envName>.json`: Configuration file per-environment. * `azure.parameters.<envName>.json`: Parameters file for Azure bicep provision per-environment. * `projectSettings.json`: Global project settings that apply to all environments.
-* `.fx/states`: Provision result that is generated by the Toolkit.
+* `.fx/states`: Provision result that is generated by the Teams Toolkit.
* `state.<envName>.json`: Provision output file per-environment. * `<env>.userdata`: User data for the provision output per-environment. * `templates`
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-template-files) |
-| 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> | [Preview app manifest in Toolkit](TeamsFx-preview-and-customize-app-manifest.md)|
+| Customize Azure Resource |Bicep files under `templates/azure` `.fx/azure.parameters.<envName>.json` | [Customize ARM parameters and templates](provision.md#customize-arm-template-files) |
+| Reuse existing Azure AD app for Teams app | `auth` section in`.fx/config.<envName>.json`| [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 |`bot` section in`.fx/config.<envName>.json`| [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 |`skipAddingSqlUser` property in`.fx/config.<envName>.json`| [Skip adding user for SQL database](provision.md#skip-adding-user-for-sql-database) |
+| Customize app manifest |`templates/manifest.template.json` file under `manifest` section in `.fx/config.<envName>.json`| [Preview app manifest in Toolkit](TeamsFx-preview-and-customize-app-manifest.md)|
## Scenarios
You can see the following scenarios to customize the resources provision in diff
You can set the Teams app name to `myapp(dev)` for the default environment `dev` and `myapp(staging)` for the staging environment `staging`.
-Follow the steps for customization:
+Steps for customization:
1. Open config file `.fx/configs/config.dev.json`.
-2. Update the property of *manifest > appName > short* to `myapp(dev)`.
+2. Update the property of **`manifest`** > **`appName`** > **short** to **`myapp(dev)`**.
- The updates to `.fx/configs/config.dev.json` are as follows:
+ The updates to `.fx/configs/config.dev.json` are:
```json {
Follow the steps for customization:
} ```
-3. Create a new environment and name it `staging` if it doesn't exist.
+3. You can 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).
+6. Now you can 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>
You can set different Teams app description for the different environments:
* 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`.
-Follow the steps for customization:
+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`.
+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:
+ The updates to `.fx/configs/config.dev.json` are:
```json {
Follow the steps for customization:
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}}`.
+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.template.json` are as follows:
+ The updates to `manifest.template.json` are:
```json {
Follow the steps for customization:
} ```
-8. Run provision command against `dev` and `staging` environment to update the app name in remote environments.
+8. You can now run provision command against `dev` and `staging` environment to update the app name in remote environments.
</details>
You can set the description of Teams app to `my app description` for all the env
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 `templates/appPackage/manifest.template.json`.
-2. Update the property `description > short` with **hard-coded string** `my app description`.
+2. Update the property **`description`** > **`short`** with hard-coded string **`my app description`**.
- The updates to `manifest.template.json` are as follows:
+ The updates to `manifest.template.json` are:
```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.
+3. You can now run the provision command against **all** environment to update the app name in remote environments.
</details> <details>
-<br><summary><b>Scenario 4: customize Azure resources for different environment</b></summary>
-You can customize Azure resources for each environment, for example edit the environment corresponding to
-fx/configs/azure.parameters.{env}.json file to specify Azure Function name.
+<br><summary><b>Scenario 4: Customize Azure resources for different environment</b></summary>
+
+You can customize Azure resources for each environment, for example edit the environment corresponding to fx/configs/azure.parameters.{env}.json file to specify Azure Function name.
-For more information on Bicep template and parameter files, see [provision cloud resources](provision.md)
+For more information on Bicep template and parameter files, see [provision cloud resources](provision.md).
</details> </br>
For more information on Bicep template and parameter files, see [provision cloud
* [Provision cloud resources](provision.md) * [Add more cloud resources](add-resource.md) * [Collaborate with other developers on Teams project](TeamsFx-collaboration.md)
+* [Test app behavior in different environment](test-app-behavior.md)
platform Teamsfx Preview And Customize App Manifest https://github.com/MicrosoftDocs/msteams-docs/commits/main/msteams-platform/toolkit/TeamsFx-preview-and-customize-app-manifest.md
Title: Teams App Manifest in Teams Toolkit
+ Title: Customize Teams App Manifest in Teams Toolkit
description: In this module, learn how to edit, preview and customize Teams App Manifest in the different environment.
Last updated 05/13/2022
-# Edit Teams app manifest for Visual Studio
+# Customize Teams app manifest
+
+The Teams app manifest describes how your app integrates into the Microsoft Teams product. For more information on Manifest, see [App manifest schema for Teams](../resources/schem). This section covers:
+
+* [Preview manifest file in local environment](#preview-manifest-file-in-local-environment)
+* [Preview manifest file in remote environment](#preview-manifest-file-in-remote-environment)
+* [Sync local changes to Dev Portal](#sync-local-changes-to-dev-portal)
+* [Customize your Teams app manifest](#customize-your-teams-app-manifest)
+* [Validate manifest](#validate-manifest)
The manifest template file `manifest.template.json` is available under `templates/appPackage` folder after scaffolding. The template file with placeholders, and the actual values are resolved by Teams Toolkit using files under `.fx/configs` and `.fx/states` for different environments.
-**To preview manifest with actual content, Teams Toolkit generates preview manifest files under `build/appPackage` folder**:
+To preview manifest with actual content, Teams Toolkit generates preview manifest files under `build/appPackage` folder:
```text ΓööΓöÇΓöÇΓöÇbuild
The manifest template file `manifest.template.json` is available under `template
ΓööΓöÇΓöÇΓöÇmanifest.local.json - Previewed manifest of local Teams app ```
-You can preview manifest file in local and remote environments.
+You can preview manifest file in local and remote environments.
* [Preview manifest file in local environment](#preview-manifest-file-in-local-environment) * [Preview manifest file in remote environment](#preview-manifest-file-in-remote-environment)
You can preview manifest file in local and remote environments.
To preview manifest file in local environment, 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 file by following the steps:
+You can also preview local manifest file by two methods
+
+* By using preview option in codelens
+* By using **Zip Teams metadata package** option
+
+The following steps help to preview local manifest file by using preview option in codelens:
+
+1. Select **Preview** in the codelens of `manifest.template.json` file.
+
+ :::image type="content" source="../assets/images/teams-toolkit-v2/teams toolkit fundamentals/preview-23.png" alt-text="Preview":::
+
+1. 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**.
+ :::image type="content" source="../assets/images/teams-toolkit-v2/teams toolkit fundamentals/select-env1.png" alt-text="Select environment1":::
+
+The following steps help to preview local manifest file by using **Zip Teams metadata package** option:
+
+1. Select `manifest.template.json` file.
+
+ :::image type="content" source="../assets/images/teams-toolkit-v2/teams toolkit fundamentals/select-manifest-json.png" alt-text="Select Manifest":::
+
+1. Select the Teams Toolkit :::image type="icon" source="../assets/images/teams-toolkit-v2/teams-toolkit-sidebar-icon.PNG"::: icon in the Visual Studio Code toolbar.
+
+1. Select **Zip Teams metadata package** under **DEPLOYMENT**.
+
+ :::image type="content" source="../assets/images/teams-toolkit-v2/teams toolkit fundamentals/teams-metadata-package.png" alt-text="Select Teams metadata package":::
+
+1. Select **local**.
+
+ :::image type="content" source="../assets/images/teams-toolkit-v2/teams toolkit fundamentals/select-env1.png" alt-text="Select environment":::
The preview local appears as shown in the image:
The preview local appears as shown in the image:
## Preview manifest file in remote environment
-**To preview manifest file in remote environment**
+To preview manifest file using Visual Studio Code:
+
+* Select **Provision in the cloud** under **DEVELOPMENT** in Teams Toolkit extension
+
+ :::image type="content" source="../assets/images/teams-toolkit-v2/teams toolkit fundamentals/provision.png" alt-text="Provision cloud resource":::
+
+To preview manifest file using command palatte:
-* Select **Provision in the cloud** under **DEVELOPMENT** in Teams Toolkit extension or
* Trigger **Teams: Provision in the cloud** from command palette.
+ :::image type="content" source="../assets/images/teams-toolkit-v2/teams toolkit fundamentals/command palatte.png" alt-text="Provision cloud resource using command palatte":::
+ It generates configuration for remote Teams app, and builds package and preview manifest under `build/appPackage` folder.
-You can also preview manifest file in remote environment by following steps:
+You can also preview manifest file by two methods in remote environment
+
+* By using preview option in codelens
+* By using **Zip Teams metadata package** option
+
+The following steps help to preview manifest file by using preview option in codelens:
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.
-> [!NOTE]
-> 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/preview-23.png" alt-text="Preview":::
+
+1. Select your environment.
+
+ > [!NOTE]
+ > 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":::
+
+The following steps help to preview manifest file by using **Zip Teams metadata package** option in remote environment:
+1. Select `manifest.template.json` file.
+
+ :::image type="content" source="../assets/images/teams-toolkit-v2/teams toolkit fundamentals/select-manifest-json.png" alt-text="Select Manifest":::
+
+1. Select the Teams Toolkit :::image type="icon" source="../assets/images/teams-toolkit-v2/teams-toolkit-sidebar-icon.PNG"::: icon in the Visual Studio Code toolbar.
+
+1. Select **Zip Teams metadata package** under **DEPLOYMENT**.
+
+ :::image type="content" source="../assets/images/teams-toolkit-v2/teams toolkit fundamentals/teams-metadata-package.png" alt-text="Select Teams metadata package":::
+
+1. Select your environment.
+
+ :::image type="content" source="../assets/images/teams-toolkit-v2/teams toolkit fundamentals/manifest preview-1.png" alt-text="Add env":::
+
+ > [!NOTE]
+ > If there are more than one environment, you need to select the environment you want to preview as shown in the image:
## Sync local changes to Dev Portal After previewing the manifest file, you can sync your local changes to Dev Portal by the following ways:
+> [!NOTE]
+> For more information on developer portal, see [Developer Portal for Teams](../concepts/build-and-test/teams-developer-portal.md).
+ 1. Deploy Teams app manifest. You can deploy Teams app manifest in any of the following ways:
If the manifest file is outdated due to configuration file change or template ch
:::image type="content" source="../assets/images/teams-toolkit-v2/teams toolkit fundamentals/manifest preview -3.png" alt-text="pre":::
-## Customize Teams app manifest
+## Customize your Teams app manifest
Teams Toolkit consists of the following manifest template files under `manifest.template.json` folder across local and remote environments:
Teams Toolkit consists of the following manifest template files under `manifest.
During the local debug or provision, Teams Toolkit loads manifest from `manifest.template.json`, with the configurations from `state.{env}.json`, `config.{env}.json`, and creates Teams app in [Dev Portal](https://dev.teams.microsoft.com/apps).
-## Supported placeholders in manifest.template.json
+### Supported placeholders in manifest.template.json
The following list provides supported placeholders in `manifest.template.json`:
During operations such as, **Zip Teams metadata package**, Teams Toolkit validat
-## Codelenses and hovers
+## To preview values for local and dev environment
In `manifest.template.json`, you can navigate to codelens to preview the values for `local` and `dev` environment.
platform Add API Connection https://github.com/MicrosoftDocs/msteams-docs/commits/main/msteams-platform/toolkit/add-API-connection.md
Title: Connect to existing APIs
+ Title: Integrate existing third party APIs
description: In this article, learn how toolkit helps you bootstrap sample access to existing APIs. It provides list of different authentication types.
Last updated 05/20/2022
-# Add API connection to Teams app
+# Integrate existing third party APIs
-Teams Toolkit helps you to access existing APIs for building Teams applications. These APIs are developed by your organization or third-party.
-
-## Advantage
-
-Teams Toolkit helps you bootstrap sample code to access the APIs if you don't have language appropriate SDKs to access these APIs.
-
-## Connect to the API
-
-When you use Teams Toolkit to connect to an existing API, Teams Toolkit performs the following function:
+Teams Toolkit helps you to access existing APIs for building Teams applications. These APIs are developed by your organization or third-party. When you use Teams Toolkit to connect to an existing API, Teams Toolkit performs the following function:
* Generate sample code under `./bot` or `./api` folder. * Add a reference to the `@microsoft/teamsfx` package to `package.json`. * Add application settings for your API in `.env.teamsfx.local` that configures local debugging.
-### Connect to API in Visual Studio Code
-
-* You can add API connection using Teams Toolkit in Visual Studio Code:
-
- 1. Open Microsoft Visual Studio Code.
- 2. Select Teams Toolkit :::image type="icon" source="../assets/images/teams-toolkit-v2/add-API/api-add-icon.png" alt-text="api icon"::: from the left navigation bar.
- 3. Select **Add features** under **DEVELOPMENT**:
-
- :::image type="content" source="../assets/images/teams-toolkit-v2/add-API/api-add-features.png" alt-text="api add features":::
-
- * You can also open the command palette and enter **Teams: Add cloud resources**.
-
- 4. From the pop-up, select the **API Connection** you want to add to your Teams app project:
-
- :::image type="content" source="../assets/images/teams-toolkit-v2/add-API/api-select-features.png" alt-text="api select features":::
-
- 5. Select **OK**.
-
- 6. Enter endpoint for the API. It's added to the project's local application settings and it's the base URL for API requests.
-
- :::image type="content" source="../assets/images/teams-toolkit-v2/add-API/api-endpoint.png" alt-text="api endpoint":::
-
- > [!NOTE]
- > Ensure the endpoint is a valid http(s) URL.
-
- 7. Select the component that accesses the API.
-
- 8. Select **OK**.
-
- :::image type="content" source="../assets/images/teams-toolkit-v2/add-API/api-invoke.png" alt-text="api invoke":::
-
- 9. Enter an alias for the API. The alias generates an application setting name for the API that is added to the project's local application setting.
-
- :::image type="content" source="../assets/images/teams-toolkit-v2/add-API/api-alias.png" alt-text="api alias":::
-
- 10. Select required authentication for the API request from the **API authentication type**. It generates appropriate sample code and adds corresponding local application settings based on your selection.
+## Steps to connect to API
- :::image type="content" source="../assets/images/teams-toolkit-v2/add-API/api-auth.png" alt-text="api auth":::
+You can add API connection using Visual Studio Code and CLI command.
- > [!NOTE]
- > Based on the authentication type selected, additional configuration is needed.
+### Add API connection using Visual Studio Code
-### API connection in TeamsFx CLI
+The following steps help you to add API connection using Visual Studio Code:
-The base command of this feature is `teamsfx add api-connection [authentication type]`. The following table provides list of different authentication types and their corresponding sample commands:
-
- > [!Tip]
- > You can use `teamsfx add api-connection [authentication type] -h` to get help document.
-
- |**Authentication type**|**Sample command**|
- |--||
- |Basic|teamsfx add api-connection basic --endpoint <https://example.com> --component bot --alias example--user-name exampleuser --interactive false|
- |API Key|teamsfx add api-connection apikey --endpoint <https://example.com> --component bot --alias example --key-location header --key-name example-key-name --interactive false|
- |Azure AD|teamsfx add api-connection aad --endpoint <https://example.com> --component bot --alias example --app-type custom --tenant-id your_tenant_id --app-id your_app_id --interactive false|
- |Certificate|teamsfx add api-connection cert --endpoint <https://example.com> --component bot --alias example --interactive false|
- |Custom|teamsfx add api-connection custom --endpoint <https://example.com> --component bot --alias example --interactive false|
+1. Open Microsoft Visual Studio Code.
+2. Select Teams Toolkit :::image type="icon" source="../assets/images/teams-toolkit-v2/add-API/api-add-icon.png" alt-text="api icon"::: from the Visual Studio Code toolbar.
+3. Select **Add features** under **DEVELOPMENT**:
-## Understand Toolkit updates to your project
+ :::image type="content" source="../assets/images/teams-toolkit-v2/add-API/api-add-features.png" alt-text="api add features":::
- Teams Toolkit modifies `bot` or `api` folder based on your selections:
+ * You can also open the command palette and enter **Teams: Add cloud resources**.
-1. Generate `{your_api_alias}.js/ts` file. The file initializes an API client for your API and exports the API client.
+4. From the pop-up, select the **API Connection** you want to add to your Teams app project:
-2. Add `@microsoft/teamsfx` package to `package.json`. The package provides support for the common API authentication methods.
+ :::image type="content" source="../assets/images/teams-toolkit-v2/add-API/api-select-features.png" alt-text="api select features":::
-3. Add environment variables to `.env.teamsfx.local`. They're the configurations for the selected authentication type. The generated code reads values from the environment variables.
+5. Select **OK**.
-## Test API connection in local environment
+6. Enter endpoint for the API. It's added to the project's local application settings and it's the base URL for API requests.
-The following steps help to test the API connection in the Teams Toolkit local environment:
+ :::image type="content" source="../assets/images/teams-toolkit-v2/add-API/api-endpoint.png" alt-text="api endpoint":::
- 1. **Run npm install**
+ > [!NOTE]
+ > Ensure the endpoint is a valid http(s) URL.
- Run `npm install` under `bot` or `api` folder to install added packages.
+7. Select the component that accesses the API.
- 2. **Add API credentials to the local application settings**
+8. Select **OK**.
- Teams Toolkit does't ask for credentials but it leaves placeholders in the local application settings file. Replace the placeholders with the appropriate credentials to access the API. The local application settings file is the `.env.teamsfx.local` file in the `bot` or `api` folder.
+ :::image type="content" source="../assets/images/teams-toolkit-v2/add-API/api-invoke.png" alt-text="api invoke":::
- 3. **Use the API client to make API requests**
+9. Enter an alias for the API. The alias generates an application setting name for the API that is added to the project's local application setting.
- Import the API client from the source code that needs access to the API:
+ :::image type="content" source="../assets/images/teams-toolkit-v2/add-API/api-alias.png" alt-text="api alias":::
- ```BASH
- import { yourApiClient } from '{relative path to the generated file}'
- ```
+10. Select required authentication for the API request from the **API authentication type**. It generates appropriate sample code and adds corresponding local application settings based on your selection.
- 4. **Generate http(s) requests to target API (with Axios)**
+ :::image type="content" source="../assets/images/teams-toolkit-v2/add-API/myAPI connection.png" alt-text="api auth":::
- The generated API client is an Axios API client. Use the Axios client to make requests to the API.
+ Based on the authentication type selected, following steps is required to completed extra configuration
- > [!Note]
- > [Axios](https://www.npmjs.com/package/axios) is a popular nodejs package that helps you with http(s) requests. For more information on how to make http(s) requests, see [Axios example documentation](https://axios-http.com/docs/example) to learn how to make http(s).
+# [Basic](#tab/basic)
-## Deploy your application to Azure
+* Enter the username for basic Auth.
-To deploy your application to Azure, you need to add the authentication to the application settings for the appropriate environment. For example, your API might have different credentials for `dev` and `prod`. Based on environment needs, configure Teams Toolkit.
+ Now the sample code got generated to call your API at bot\myAPI.js.
-Teams Toolkit configures your local environment. The bootstrapped sample code contains comments that tell you what app settings you need to configure. For more information on application settings, see [Add app settings](https://github.com/OfficeDev/TeamsFx/wiki/%5BDocument%5D-Add-app-settings).
+# [Certification](#tab/certification)
-## Advanced scenarios
+ Now the sample code got generated to call your API at bot\myAPI.js.
- The following section explains you advanced scenarios:
+# [Azure Active Directory](#tab/AAD)
-<br>
+ Now the sample code got generated to call your API at bot\myAPI.js.
-<details>
-<summary><b>Custom authentication provider</b></summary>
+# [API Key](#tab/apikey)
-Besides the authentication provider included in `@microsoft/teamsfx` package, you can also implement customized authentication provider that implements `AuthProvider` interface and use it in `createApiClient(..)` function:
+* Select the required API key position in request.
-```Bash
-import { AuthProvider } from '@microsoft/teamsfx'
+* Enter an API key name.
-class CustomAuthProvider implements AuthProvider {
- constructor() {
- // You can add necessary parameters for your customized logic in constructor
- }
+ Now the sample code got generated to call your API at bot\myAPI.js.
- AddAuthenticationInfo: (config: AxiosRequestConfig) => Promise<AxiosRequestConfig> = async (
- config
- ) => {
- /*
- * The config parameter contains all the request information and can be updated to include extra authentication info.
- * Refer https://axios-http.com/docs/req_config for detailed document for the config object.
- *
- * Add your customized logic that returns updated config
- */
- };
-}
-```
+# [Custom Auth Implementation](#tab/CustomAuthImplementation)
-</details>
-<details>
-<summary><b>Connect to APIs for Azure AD permissions</b></summary>
-Azure AD authenticates some services. The following list helps to access these services for configuring API permissions.
+ Now the sample code got generated to call your API at bot\myAPI.js.
-* [Use Access Control Lists (ACLs)](#access-control-lists-acls)
-* [Use Azure AD application permissions](#azure-ad-application-permissions)
+
-Obtaining a token with the right resource scopes for your API depends on the implementation of the API.
+## Add API connection using CLI
-You can follow the steps to access these APIs while using:
+The base command of this feature is `teamsfx add api-connection [authentication type]`. The following table provides list of different authentication types and their corresponding sample commands:
-#### Access Control Lists (ACLs)
+ > [!TIP]
+ > You can use `teamsfx add api-connection [authentication type] -h` to get help document.
- 1. Start local debug on cloud environment for your project. It creates an Azure AD Application Registration your Teams application.
-
- 2. Open `.fx/states/state.{env}.json`, and note the value of `clientId` under `fx-resource-aad-app-for-teams` property.
+ |**Authentication type**|**Sample command**|
+ |--||
+ |Basic|teamsfx add api-connection basic--endpoint <https://example.com> --component bot--alias example--user-name exampleuser--interactive false|
+ |API Key|teamsfx add api-connection apikey--endpoint <https://example.com> --component bot--alias example--key-location header--key-name example-key-name--interactive false|
+ |Azure AD|teamsfx add api-connection aad--endpoint <https://example.com> --component bot--alias example--app-type custom--tenant-id your_tenant_id--app-id your_app_id--interactive false|
+ |Certificate|teamsfx add api-connection cert--endpoint <https://example.com> --component bot--alias example--interactive false|
+ |Custom|teamsfx add api-connection custom--endpoint <https://example.com> --component bot--alias example--interactive false|
- 3. Provide the client ID to the API provider to configure ACLs on the API service.
+
-#### Azure AD application permissions
+## Directory structure updates to your project
- 1. Open `templates/appPackage/aad.template.json` and add following content to `requiredResourceAccess` property:
+ Teams Toolkit modifies `bot` or `api` folder based on your selections:
-```JSON
- {
- "resourceAppId": "The AAD App Id for the service providing the API you are connecting to",
- "resourceAccess": [
- {
- "id": "Target API's application permission Id",
- "type": "Role"
- }
- ]
- }
-```
+1. Generate `{your_api_alias}.js/ts` file. The file initializes an API client for your API and exports the API client.
- 2. Start local debug on cloud environment for your project. It creates an Azure AD Application Registration your Teams application.
+2. Add `@microsoft/teamsfx` package to `package.json`. The package provides support for the common API authentication methods.
- 3. Open `.fx/states/state.{env}.json` and note the value of `clientId` under `fx-resource-aad-app-for-teams` property. It's the application client ID.
+3. Add environment variables to `.env.teamsfx.local`. They're the configurations for the selected authentication type. The generated code reads values from the environment variables.
- 4. Grant admin consent for the required application permission, for more information, see [grant admin consent](/azure/active-directory/manage-apps/grant-admin-consent#grant-admin-consent-in-app-registrations).
+## Advantages
- > [!NOTE]
- > For application permission use your client ID.
- >
-</details>
+Teams Toolkit helps you bootstrap sample code to access the APIs, if you don't have language appropriate SDKs to access these APIs.
## See also
platform Add Capability https://github.com/MicrosoftDocs/msteams-docs/commits/main/msteams-platform/toolkit/add-capability.md
Title: Add Capabilities to Your Teams apps-
-description: In this module, learn how to add Capabilities of Teams Toolkit, advantages, limitations and capabilities
-+
+description: In this module, learn how to add Capabilities of Teams Toolkit
+ ms.localizationpriority: medium Last updated 11/29/2021
-# Add capabilities to Teams apps
+# Add capabilities to Microsoft Teams apps
-Add capability in Teams Toolkit helps you to add additional capability to your existing Teams app.The following table lists the Teams app capabilities:
+Adding capabilities with Teams Toolkit helps you to include additional features to your existing Teams app. The advantage of adding more capabilities is that you can add more functions to your app by automatically adding source codes using Teams Toolkit. You can also choose different capabilities based on project you've created in your Teams app. The following table lists the Teams app capabilities:
-|**Capability**|**Description**|
-|--|-|
-| Tabs | Tabs are simple HTML tags that refer 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.|
-| Message extensions | Message extensions help to interact with your web service through buttons and forms in the Microsoft Teams client.|
+|Capability|Description|Other supported capabilities|
+|--|-|--|
+|**Basic Teams app**| |
+| Tab | Tabs are simple HTML tags that refer 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.|Tab, notification bot, command bot, bot, message extension|
+|SPFx tab| SPFx tab apps are hosted in Microsoft 365 and it supports developing and hosting your client-side SPFx solution|None|
+|SSO-enabled tab|You can build SSO-enabled tab app that allows the user with single sign on feature|SSO-enabled tab, notification bot, command bot, bot, message extension|
+| Bot | Bots help to interact with your web service through text, interactive cards, and task modules.|Message extension, SSO-enabled tab, tab|
+| Message extension | Message extensions help to interact with your web service through buttons and forms in the Microsoft Teams client.|Bot, SSO-enabled tab, tab|
+|**Scenario-based Teams app**| |
+| Notification bot | Notification bot proactively sends messages in Teams channel or group chat or personal chat. You can trigger the notification bot with a HTTP request, such as cards or texts. |SSO-enabled tab, tab|
+| Command bot | Command bot allows you to automate repetitive tasks using a command bot. It responds to simple commands sent in chats with adaptive cards. |SSO-enabled tab, tab|
-## Advantages
-
-The following list provides advantages to add more capabilities in TeamsFx:
-
-* Provides convenience.
-* Adds more function to your app by automatically adding source codes using Teams Toolkit.
-
-## Limitations
-
-The following list provides limitations to add more capabilities in TeamsFx:
-
-* You can add tabs up to 16 instances.
-* You can add a bot and message extension for one instance each.
+> [!NOTE]
+> You can add tabs up to 16 instances. As for your bot and message extension, you can add one for each instance at a time.
## Add capabilities
-**You can add capabilities by the following methods:**
-
-* To add capabilities by using Teams Toolkit in Visual Studio Code.
-* To add capabilities by using command palette.
+You can add capabilities by the following methods:
- > [!Note]
- > You need to provision for each environment, after you have successfully added the capabilities in your Teams app.
+* [Using Teams Toolkit in Microsoft Visual Studio Code](#using-teams-toolkit-in-microsoft-visual-studio-code)
+* [Using the Command Palette](#using-the-command-palette)
+* [Using TeamsFx CLI](#using-teamsfx-cli)
-* **To add capabilities by using Teams Toolkit in Visual Studio Code:**
+### Using Teams Toolkit in Microsoft Visual Studio Code
1. Open **Visual Studio Code**.
- 1. Select **Teams Toolkit** from left panel.
+ 1. Select **Teams Toolkit** from the activity bar.
1. Select **Add features** under **DEVELOPMENT**.
- :::image type="content" source="~/assets/images/teams-toolkit-v2/manual/select-feature123.png" alt-text="updated one":::
+ :::image type="content" source="~/assets/images/teams-toolkit-v2/manual/select-feature123.png" alt-text="Add capabilities from Teams Toolkit":::
-* **To add capabilities by using command palette:**
+ > [!NOTE]
+ > After successfully adding the capabilities in your Teams app, you need to provision for each environment.
- 1. Open **command palette**.
- 1. Enter **Teams:Add features**.
- 1. Press **Enter**.
+### Using the Command Palette
+
+ 1. Select **View** > **Command Palette...** or **Ctrl+Shift+P**.
+
+ :::image type="content" source="../assets/images/teams-toolkit-v2/manual/add-capabilities-command-palette.png" alt-text="Add capabilities from command palatte":::
+
+ 1. Enter **Teams: Add features**.
+ 1. Press enter.
:::image type="content" source="~/assets/images/teams-toolkit-v2/manual/teams-add-features.png" alt-text="To add capabilities by using command palette.":::
- 1. From the pop-up, select the capability to add in your project.
+ 1. From the pop-up, select the capability you need to add in your project.
:::image type="content" source="~/assets/images/teams-toolkit-v2/manual/notification-add-capabilities.png" alt-text="notification":::
-## Add capabilities using TeamsFx CLI
+### Using TeamsFx CLI
* Change directory to your **project directory**. * The following table lists the capabilities and required commands:
The following list provides limitations to add more capabilities in TeamsFx:
|To add bot |`teamsfx add bot`| |To add message extension |`teamsfx add message extension`|
-## Available capabilities to add for different Teams project
-
-You can choose to add different capabilities based on project you have created in Teams app.
-The following table lists the available capabilities to add in your project:
-
-|Existing capabilities|Other supported capabilities|
-|--|--|
-|SPFx tab |None|
-|SSO-enabled tab |SSO-enabled tab, notification bot, command bot, bot, message extension|
-|Notification bot |SSO-enabled tab, tab|
-|Command bot |SSO-enabled tab, tab|
-|Tab |Tab, notification bot, command bot, bot, message extension|
-|Bot |Message extension, SSO-enabled tab, tab|
-|Message extension |Bot, SSO-enabled tab, tab |
-
-## Add bot, tab and message extension
-
-After adding a bot and message 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.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.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.
+## Changes after adding capabilities
+
+The following table shows the changes that can be seen in the files of your app when adding the capabilities:
+
+|Add capability|Description| Changes|
+||||
+|Bot, message extension and tab|Includes a **hello world**&nbsp;bot or tab application template into your project.|A frontend bot or tab template code is added into a subfolder with path `yourProjectFolder/bot` or `yourProjectFolder/tab` respectively.|
+| Bot, message extension and tab |Includes necessary scripts for Visual Studio Code, and is executed when you want to debug your application locally. |Files `launch.json` and `task.json` under `.vscode` folder are updated.|
+| Bot and message extension|Includes bot or tab-related information in the manifest file that represents your application in Teams Platform.|File`manifest.template.json` 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 visible in ID of your bot, scopes of your bot, and the commands that hello world bot or tab application can respond to.|
+|Tab|Includes bot or tab-related information in the manifest file that represents your application in Teams Platform.|File`manifest.template.json` 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 visible in configurable and static tabs, and scopes of the tabs.|
+|Bot, message extension and tab|Includes bot or tab-related&nbsp;information in the teamsfx and provision files that are for integrating Azure functions.|Files under `templates/azure/teamsfx` are updated, and `templates/azure/provision/xxx`.bicep files are regenerated.|
+|Bot, message extension and tab|Ensures your project is set with right configurations for newly added capability.|Files under `.fx/config` are regenerated|
## Step-by-step guide
platform Add Resource https://github.com/MicrosoftDocs/msteams-docs/commits/main/msteams-platform/toolkit/add-resource.md
Last updated 11/29/2021
-# Add cloud resources to Teams app
+# Add cloud resources to Microsoft Teams app
-TeamsFx helps to provision the cloud resources for your application hosting. You can add the cloud resources optionally, that fit your development needs.
+Teams Toolkit helps you to provision the cloud resources for your application hosting. You can add the cloud resources optionally, that fit your development needs. The advantage of adding more cloud resources in TeamsFx is that you can autogenerate all configuration files and connect to Teams app by using Teams Toolkit.
-## Advantages
-
-The following list provides advantages to add more cloud resources in TeamsFx:
-
-* Provides convenience.
-* Autogenerates all configuration files and connect to Teams app by using Teams Toolkit.
-
-## Limitation
-
-If you have created SPFx based tab project, you can't add Azure cloud resources.
+> [!NOTE]
+> If you have created SPFx based tab project, you can't add Azure cloud resources.
## Add cloud resources
-**You can add cloud resources by the following methods:**
-
-* To add cloud resources by using Teams Toolkit in Visual Studio Code.
-* To add cloud resources by using command palette.
+You can add cloud resources by the following methods:
- > [!NOTE]
- > You need to provision for each environment, after you have successfully added the resource in your Teams app.
-
-* **To add cloud resources by using Teams Toolkit in Visual Studio Code:**
+### To add cloud resources by using Teams Toolkit in Visual Studio Code
1. Open **Visual Studio Code**.
- 1. Select **Teams Toolkit** from left panel.
+ 1. Select **Teams Toolkit** from the activity bar.
1. Select **Add features** under **DEVELOPMENT**.
- :::image type="content" source="~/assets/images/teams-toolkit-v2/manual/cloud/select-feature-updated.png" alt-text="add feature":::
+ :::image type="content" source="~/assets/images/teams-toolkit-v2/manual/cloud/select-feature-updated.png" alt-text="Add feature from Teams Toolkit":::
+
+### To add cloud resources by using command palette
+
+ 1. Select **View** > **Command Palette...** or **Ctrl+Shift+P**.
-* **To add cloud resources by using command palette:**
+ :::image type="content" source="~/assets/images/teams-toolkit-v2/manual/cloud/Teams-add-features.png" alt-text="Add feature from command palette":::
- 1. Open **command palette**.
- 1. Enter **Teams:Add features**.
+ 1. Enter **Teams: Add features**.
1. Press **Enter**.
- :::image type="content" source="~/assets/images/teams-toolkit-v2/manual/cloud/Teams-add-features.png" alt-text="cloud":::
+ :::image type="content" source="../assets/images/teams-toolkit-v2/manual/cloud/Teams-add-features1.png" alt-text="Type add feature and enter":::
- 1. From the pop-up, select the cloud resources to add in your project.
+ 1. From the pop-up, select the **Cloud resources** to add in your project.
- :::image type="content" source="~/assets/images/teams-toolkit-v2/manual/cloud/updated-final-cloud.png" alt-text="final":::
+ :::image type="content" source="~/assets/images/teams-toolkit-v2/manual/cloud/updated-final-cloud.png" alt-text="final":::
+
+ > [!NOTE]
+ > You need to provision for each environment, after you have successfully added the resource in your Teams app.
-## Add cloud resources using TeamsFx CLI
+### Add cloud resources using TeamsFx CLI
* Change directory to your **project directory**. * The following table lists the capabilities and required commands:
In the following scenarios, TeamsFx integrates with Azure
* [Azure API management](deploy.md): An API gateway can be used to administer APIs created for Teams applications and publish them to consume on other applications, such as Power apps. * [Azure Key Vault](/azure/key-vault/general/overview): Safeguard cryptographic keys and other secrets used by cloud apps and services.
-## Add Cloud resources
+## Changes after adding Cloud resources
The following changes appear after adding resources in your project:
platform Build Environments https://github.com/MicrosoftDocs/msteams-docs/commits/main/msteams-platform/toolkit/build-environments.md
+
+ Title: Prepare to build apps with Teams Toolkit
+
+description: In this article, you'll learn how to build environment of Teams Toolkit and manage the app in Developer Portal
+
+ms.localizationpriority: medium
+ Last updated : 11/29/2021++
+# Prepare to build apps using Microsoft Teams Toolkit
+
+Teams Toolkit supports environments for creating apps. Teams Toolkit also helps to integrate Azure Functions capabilities as well as cloud services in the Teams app you've built.
++
+## Build environments
+
+Teams Toolkit in Microsoft Visual Studio Code offers set of environments to build your Teams app. You can choose anyone of the following environment that best suits your app:
+
+* JavaScript or TypeScript
+* SharePoint Framework (SPFx)
+
+### Create your Teams app using JavaScript or TypeScript
+
+The apps built with JavaScript have the following advantages:
+
+* App comes with its own UI and UX capabilities that are rich and user friendly.
+* Provides quick upgrades to existing apps.
+* Distributes apps on multiple platforms, such as Android and iOS.
+* Compatible for creating an app with existing APIs.
+
+Teams Toolkit in Visual Studio Code supports building the following apps using JavaScript or TypeScript:
+
+* Tab app: Your tab app can have web-based content, you can have a custom tab for your web content in Teams or add Teams-specific functionality to your web content.
+* Bot app: Bots can be chat bot or conversational bot that allows you to do simple and repetitive tasks like customer service or support staff.
+* Notification bot: You can send messages in Teams channel or group or personal chat by Notification bots with HTTP request.
+* Command bot: You can automate repetitive tasks using command bot. Command bots help you to answers simple queries or commands sent in chats.
+* Message extensions: You can interact with your web service through buttons and forms. Capability provided by message extension.
+
+### Create your Teams app using SPFx
+
+Teams Toolkit in Visual Studio Code allows you to create tab apps using SPFx. These apps have the following advantages:
+
+* Provides you easy integration with data residing in SharePoint to your Teams.
+* You can integrate your SPFx solution with your business APIs secured with Microsoft Azure Active Directory (Azure AD).
+* Gives you Accesses to various open-source tools.
+* Creates for your powerful applications that can deliver a great UX.
+* Integrates with other Microsoft (Office) 365 workloads easily.
+* Delivers flexibility to host applications wherever needed.
+
+## Support for Azure Functions
+
+You can use Teams Toolkit to integrate [Azure Functions](/azure/azure-functions/functions-overview) capabilities into building apps. You can focus on the pieces of code that matter most and Azure Functions do the rest.
+Azure Functions allow you to implement:
+
+1. System logic into your readily available blocks of code. These blocks are called functions.
+1. As the requests increases, Azure Functions meets the requirement with as many demands as necessary.
+
+Azure Function integrates with an array of [cloud services](add-resource.md#types-of-cloud-resources) provide feature-rich implementations. The following are just a few common scenarios for Azure Functions:
+
+* When building a web API
+* Processing to database changes
+* Processing Iot data streams
+* Managing message queues
+
+## See also
+
+* [Teams Toolkit for Visual Studio](visual-studio-overview.md)
+* [Manage your Teams apps using Developer Portal](../concepts/build-and-test/teams-developer-portal.md)
+* [Create a new Teams app using Teams Toolkit](create-new-project.md)
platform Create New Project https://github.com/MicrosoftDocs/msteams-docs/commits/main/msteams-platform/toolkit/create-new-project.md
Title: Create a new Teams app using Teams Toolkit
+ Title: Create a new Teams app
-description: In this module, learn how to create a new Teams app using Teams Toolkit, create a new Teams app using view samples
+description: In this module, learn how to create a new Teams app using Teams Toolkit
ms.localizationpriority: high Last updated 03/14/2022
-# Create a new Teams app using Teams Toolkit
+# Create a new Teams project
-To create a new Teams app using Teams Toolkit, you can select from one of the following options:
+You can build a new Teams project by selecting **Create a new Teams app** in Teams Toolkit. You can create following types of app in Teams Toolkit:
-* [Create a new Teams app](create-new-project.md#create-a-new-teams-app)
-* [View samples](create-new-project.md#create-a-new-teams-app-using-view-samples)
+| App Type | Definition |
+| | |
+| Basic Teams app | Basic Teams apps are tab, bot, or message extension app that you can create and customize based on your needs. |
+| Scenario based Teams app | Scenario based Teams apps are notification bot, command bot, SSO-enabled tab, or SPFx tab app and it's suitable for one particular scenario. For example, notification bot is suitable only to send notification and not used for chat. |
## Create a new Teams app
+The steps to create a new Teams app is similar for all types of app except SPFx, and notification bot. The following steps help you to build a new tab app:
+
+**To create an app**
+ 1. Open Visual Studio Code.
-1. Select the Teams Toolkit :::image type="icon" source="../assets/images/teams-toolkit-v2/teams-toolkit-sidebar-icon.PNG"::: icon in the Visual Studio Code sidebar.
+
+1. Select the Teams Toolkit :::image type="icon" source="../assets/images/teams-toolkit-v2/teams-toolkit-sidebar-icon.png"::: icon in the left navigation bar.
+ 1. Select **Create a new Teams app**.
- :::image type="content" source="../assets/images/teams-toolkit-v2/teams-toolkit-sidebar.png" alt-text="Teams toolkit sidebar":::
+ :::image type="content" source="../assets/images/teams-toolkit-v2/first-tab/create-project.png" alt-text="Location of the Create New Project link in the Teams Toolkit sidebar.":::
-1. You can select **Create a new Teams app** or **Start from a sample**.
+1. Ensure that **Tab** is selected as your app capability.
- :::image type="content" source="../assets/images/teams-toolkit-v2/select-create-app.png" alt-text="Create an app":::
+ :::image type="content" source="../assets/images/teams-toolkit-v2/first-tab/select-capabilities-tabapp.png" alt-text="Select App Capability":::
-1. If you select **Create a new Teams app**, the following image displays with templates from three categories: Scenario-based Teams app, Basic Teams app, and Extended Teams apps across Microsoft 365:
+1. Select **JavaScript** as the programming language.
- :::image type="content" source="../assets/images/teams-toolkit-v2/teams-capabilities.png" alt-text="Capabilties for Teams app":::
+ :::image type="content" source="../assets/images/teams-toolkit-v2/first-tab/select-language-tab.png" alt-text="Screenshot showing how to select the programming language.":::
-1. Select at least one option to start creating the Teams app.
+1. Select **Default folder** to store your project root folder in default location.
-## Create a new Teams app using view samples
+ :::image type="content" source="../assets/images/teams-toolkit-v2/first-tab/select-default-location.png" alt-text="Select default location":::
-You can create a new app by exploring **View samples** and selecting an existing sample. The selected sample may already have some functionality, for example a to-do list with an Azure backend, or an integration with the Microsoft Graph Toolkit.
+ The following steps guides you to change the default location:
- 1. Open **Teams Toolkit** from Microsoft Visual Studio Code.
- 1. Select **DEVELOPMENT** section in Treeview.
- 1. Select **View samples**.
+ 1. Select **Browse**.
- :::image type="content" source="../assets/images/teams-toolkit-v2/view-samples.png" alt-text="View samples":::
+ :::image type="content" source="../assets/images/teams-toolkit-v2/first-tab/select-browse.png" alt-text="Select browse for storage":::
- The sample gallery appears as shown in the following image:
+ 1. Select the location for project workspace.
- :::image type="content" source="../assets/images/teams-toolkit-v2/sample-gallery.png" alt-text="Sample gallery":::
+ 1. Select the **Select Folder**.
- You can explore the sample gallery as follows:
+ :::image type="content" source="../assets/images/teams-toolkit-v2/select-folder.png" alt-text="select-folder for storage":::
- 1. Select a sample to browse detailed information.
- 1. Select **create** in information page of each sample to download it.
- 1. Run your app locally or remotely to preview in Teams web client by following the instructions which automatically opens after you download the sample.
- 1. If you donΓÇÖt want to download the samples, you can select **View on GitHub** to open the sample in the GitHub Samples repository and browse the source code.
+1. Enter `helloworld` as the application name. Ensure that you use only alphanumeric characters. Select **Enter**.
-## Step-by-step guides using Teams Toolkit
+ :::image type="content" source="../assets/images/teams-toolkit-v2/first-tab/enter-name-tab1.png" alt-text="Screenshot showing where to enter the app name.":::
-* [Build a Teams app with Blazor](../sbs-gs-blazorupdate.yml)
-* [Build a Teams app with JavaScript using React](../sbs-gs-javascript.yml)
-* [Build a Teams app with SPFx](../sbs-gs-spfx.yml)
-* [Build a Teams app with C# or .NET](../sbs-gs-csharp.yml)
-* [Send notification to Teams](../sbs-gs-notificationbot.yml)
-* [Build command bot](../sbs-gs-commandbot.yml)
+1. By default, project opens in new window within 10 seconds. If you want to open in current window, select **Open in current window**.
+
+ :::image type="content" source="../assets/images/teams-toolkit-v2/first-tab/new-window-notification.png" alt-text="New window notification":::
+
+ The Teams tab app is created in a few seconds.
+
+ :::image type="content" source="../assets/images/teams-toolkit-v2/first-tab/tap-app-created1.png" alt-text="Screenshot showing the app created.":::
++
+### Directory structure for different app types
+
+Teams Toolkit provides all components for building an app. After creating the project, you can view the project folders and files under **Explorer**.
+
+<br>
+<details>
+<summary><b>Directory structure for basic Teams app</b></summary>
+
+You have three different types of basic Teams app and directory structure looks similar for all types of apps. The following example shows a basic Teams tab app directory structure:
+
+| Folder name | Contents |
+| | |
+| `.fx/configs` | Configuration files that user can customize for the Teams app. |
+| - `.fx/configs/config.<envName>.json` | Configuration file for every environment. |
+| - `.fx/configs/azure.parameters.<envName>.json` | Parameters file for Azure BICEP provision for every environment. |
+| - `.fx/configs/projectSettings.json` | Global project settings that apply to all environments. |
+| `tabs` | Code for the Tab capability needed at runtime, such as the privacy notice, terms of use, and configuration tabs. |
+| - `tabs/src/index.jsx` | Entry point for the front-end app, where the main App component is rendered with `ReactDOM.render()` |
+| - `tabs/src/components/App.jsx` | Code for handling URL routing in the app. It calls the [Microsoft Teams JavaScript client SDK](../tabs/how-to/using-teams-client-sdk.md) to establish communication between your app and Teams. |
+| - `tabs/src/components/Tab.jsx` | Code to implement the UI of your app. |
+| - `tabs/src/components/TabConfig.jsx` | Code to implement the UI that configures your app. |
+| `templates/appPackage` | App manifest template files, and the app icons: color.png and outline.png. |
+| - `templates/appPackage/manifest.template.json` | App manifest for running the app in local or remote environment. |
+| `templates/azure` | BICEP template files |
+
+> [!NOTE]
+> If you have a bot or message extension app, relevant folders is added to the directory structure.
+
+To learn more about the directory structure of different types of basic Teams app, see the following table:
+
+| App Type | Links |
+| | |
+| For tab app | [Build your first tab app using JavaScript](../sbs-gs-javascript.yml) |
+| For bot app | [Build your first bot app using JavaScript](../sbs-gs-bot.yml) |
+| For message extension app | [Build your first message extension app using JavaScript](../sbs-gs-msgext.yml) |
+
+</details>
+<br>
+<details>
+<summary><b>Directory structure for scenario based Teams app</b></summary>
+
+You have four different types of scenario based Teams app and directory structure looks similar for all types of apps. The following example shows a scenario based notification bot Teams app directory structure:
+
+The new project folder contains following content:
+
+| Folder name | Contents |
+| | |
+| `.fx` | Project level settings, configuration, and environment information |
+| `.vscode` | VS code files for local debug |
+| `bot` | The bot source code |
+| `templates` | Templates for Teams app manifest and corresponding Azure resources |
+
+The core notification implementation in **bot** folder and it contains:
+
+| File name | Contents |
+| | |
+| `src/adaptiveCards/` | Templates for Adaptive card |
+| `src/internal/` | Generated initialize code for notification functionality |
+| `src/index.*s` | The entrypoint to handle bot messages and send notifications |
+| `.gitignore` | File to exclude local files from bot project |
+| `package.json` | The npm package file for bot project |
+
+> [!NOTE]
+> If you have a command bot, SSO-enabled tab, or SPFx tab app, relevant folders is added to the directory structure.
+
+To learn more about the directory structure of different types of scenario based Teams app, see the following table:
+
+| App Type | Links |
+| | |
+| For notification bot app | [Send notification to Teams](../sbs-gs-notificationbot.yml) |
+| For command bot app | [Build command bot](../sbs-gs-commandbot.yml) |
+| For SPFx tab app | [Build a Teams app with SPFx](../sbs-gs-spfx.yml) |
+
+</details>
+<br>
+<details>
+<summary><b>Directory structure for multi-capability app</b></summary>
+
+You can add more features to your existing Teams app by using add features. For example, if you add bot app to the existing tab app, Teams Toolkit adds the bot folder with relevant files and code.
+
+The following image shows the directory structure of tab app:
+
+ :::image type="content" source="../assets/images/teams-toolkit-v2/tabapp-directory.png" alt-text="Tab app directory structure":::
+
+The following image shows the directory structure of tab app with bot feature:
+
+ :::image type="content" source="../assets/images/teams-toolkit-v2/tab-app-with-bot-app.png" alt-text="Tab app with bot app directory structure":::
+
+</details>
## See also
-* [Provision cloud resources](provision.md)
-* [Deploy Teams app to the cloud](deploy.md)
-* [Publish your Teams app](../concepts/deploy-and-publish/appsource/publish.md)
-* [Manage multiple environments](TeamsFx-multi-env.md)
-* [Collaborate with other developers on Teams project](TeamsFx-collaboration.md)
+* [Build a Teams app with Blazor](../sbs-gs-blazorupdate.yml)
+* [Build a Teams app with C# or .NET](../sbs-gs-csharp.yml)
+* [Prerequisites for all types of environment and create your Teams app](tools-prerequisites.md)
+* [Prepare to build apps using Microsoft Teams Toolkit](build-environments.md)
platform Debug Background Process https://github.com/MicrosoftDocs/msteams-docs/commits/main/msteams-platform/toolkit/debug-background-process.md
Title: Debug background processes-
-description: In this module, learn function of Visual studio code and Teams Toolkit during local debug and register and configure your Teams app
-+
+description: In this module how Visual studio code and Teams Toolkit work during local debug process, also how to register and configure your Teams app
+ ms.localizationpriority: high Last updated 03/03/2022
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 (VS Code). The VS Code launches the debuggers, and Microsoft Edge or Google Chrome launches a new browser instance as follows:
+The local debug process involves the `.vscode/launch.json` and `.vscode/tasks.json` files to configure the debugger in Microsoft Visual Studio Code. The Visual Studio Code launches the debuggers, and Microsoft Edge or Google Chrome launches a new browser instance.
-1. The `launch.json` file configures the debugger in VS Code.
+The debug process workflow is as follows:
-2. VS Code runs the compound **preLaunchTask**, **Pre Debug Check & Start All** in `.vscode/tasks.json` file.
+1. `launch.json` file configures the debugger in Visual Studio Code.
-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**.
+2. Visual Studio 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**.
4. Microsoft Edge or Google Chrome launches a new browser instance and opens a web page to load Teams client.
-## Prerequisites
+## Teams Toolkit verification of prerequisites
Teams Toolkit checks the following prerequisites during the debug process:
Teams Toolkit checks the following prerequisites during the debug process:
|Bot | 14, 16 (recommended)| |Message extension | 14, 16 (recommended) |
-* 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 then the local debug terminates.
-* Ngrok binary version 2.3 is applicable for bot and message 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`. Ngrok NPM package in `/.fx/bin/ngrok/node modules/ngrok/bin` manages the Ngrok binary.
-* 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`. 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 isn't 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.
-* Ngrok binary version 2.3 is applicable for bot and message 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 4, 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`. 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 isn't 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.
+* Teams Toolkit prompts you to sign-in to Microsoft 365 account, if you haven't signed in with your valid credentials.
+* Custom app uploading or sideloading for your developer tenant is turned on, to prevent local debug termination.
+* Teams Toolkit installs Ngrok NPM package `ngrok@4.2.2` in `~/.fx/bin/ngrok`, if Ngrok isn't installed or the version doesn't match the requirement. Ngrok NPM package in `/.fx/bin/ngrok/node modules/ngrok/bin` manages the Ngrok binary version 2.3 that is applicable for bot and message extension.
+* Teams Toolkit installs Azure Functions Core Tools NPM package, azure-functions-core-tools@3 for **Windows** and **macOs** in `~/.fx/bin/func`, if Azure Functions Core Tools version 3 isn't installed or the version doesn't match the requirement. 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.
+* Teams Toolkit installs .NET Core SDK for **Windows** and **MacOS** in `~/.fx/bin/dotnet`, if .NET Core SDK version applicable for Azure Functions isn't installed or the version doesn't match the requirement. For Linux, the local debug terminates.
+* Teams Toolkit installs Ngrok NPM package `ngrok@4.2.2` in `~/.fx/bin/ngrok`, if Ngrok isn't installed or the version doesn't match the requirement. Ngrok binary version 2.3 is applicable for bot and message extension. The Ngrok binary is managed by Ngrok NPM package in `/.fx/bin/ngrok/node modules/ngrok/bin`.
+* Teams Toolkit installs Azure Functions Core Tools NPM package, azure-functions-core-tools@3 for **Windows** and **MacOs** in `~/.fx/bin/func`, if Azure Functions Core Tools version 4 isn't installed or the version doesn't match the requirement. 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.
+* Teams Toolkit installs .NET Core SDK for **Windows** and **MacOS** in `~/.fx/bin/dotnet`.NET Core SDK version applicable for Azure Functions, if .NET Core SDK isn't installed or the version doesn't match the requirement. 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 isn't 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 isn't installed, the Teams Toolkit installs Azure Functions binding extensions.
-* NPM packages, applicable for tab app, bot app, message extension app, and Azure Functions. If NPM isn't installed, the Teams Toolkit installs all NPM packages.
-* Bot and message extension, the Teams Toolkit starts Ngrok to create an HTTP tunnel for bot and message extension.
+* Development certificate, if the development certificate for localhost isn't installed for tab in **Windows** or **MacOS**, then Teams Toolkit prompts you to install it.
+* Azure Functions binding extensions defined in `api/extensions.csproj`, if Azure Functions binding extensions isn't installed, then Teams Toolkit installs Azure Functions binding extensions.
+* NPM packages, applicable for tab app, bot app, message extension app, and Azure Functions. If NPM packages aren't installed, then Teams Toolkit installs all NPM packages.
+* Bot and message extension, Teams Toolkit starts Ngrok to create an HTTP tunnel for bot and message extension.
* Ports available, if tab, bot, message extension, and Azure Functions ports are unavailable, the local debug terminates. The following table lists the ports available for components:
Use the following .NET Core versions:
When you select **Start Debugging (F5)**, the Teams Toolkit output channel displays the progress and result after checking the prerequisites.
- :::image type="content" source="../assets/images/teams-toolkit-v2/debug/prerequisites-debugcheck.png" alt-text="prerequisites":::
+ :::image type="content" source="../assets/images/teams-toolkit-v2/debug/prerequisites-debugcheck.png" alt-text="Prerequisites check summary" lightbox="../assets/images/teams-toolkit-v2/debug/prerequisites-debugcheck.png":::
## Register and configure Teams app 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 Microsoft Azure Active Directory(Azure AD) app](#registers-and-configures-microsoft-azure-active-directoryazure-ad-app)
-1. [Registers and configures bot](#registers-and-configures-bot): Teams Toolkit registers and configures your bot for tab or message extension app.
+1. [Registers and configures bot](#registers-and-configures-bot).
-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).
-### Registers and configures Azure AD application
+### Registers and configures Microsoft Azure Active Directory(Azure AD) app
-1. Registers an Azure AD application.
+1. Registers an Azure AD app.
1. Creates a Client Secret.
For tab app or message extension app:
### 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.template.json`.
+Registers a Teams app in [Developer Portal](https://dev.teams.microsoft.com/home) using the manifest template in `templates/appPackage/manifest.template.json`.
After registration and configuration of the app, local debug files generates. ## Take a tour of your app source code
-You can view the project folders and files under **Explorer** in VS 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 under **Explorer** in Visual Studio 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 | | | | |
platform Debug Local https://github.com/MicrosoftDocs/msteams-docs/commits/main/msteams-platform/toolkit/debug-local.md
Title: Debug your Teams app
+ Title: Debug your Teams app locally
+ description: In this module, learn how to debug your Teams app locally in Teams Toolkit and key features of Teams Toolkit-+ ms.localizationpriority: high Last updated 03/21/2022
-# Debug your Teams app locally
+# Debug your Microsoft Teams app locally
-Teams Toolkit helps you to debug and preview your Teams app locally. Debug is the process of checking, detecting, and correcting issues or bugs to ensure the program runs successfully. Visual Studio Code allows you to debug tab, bot, message extension, and Azure Functions. Teams Toolkit supports the following debug features:
+Microsoft Teams Toolkit helps you to debug and preview your Teams app locally. During the debug process, Teams Toolkit automatically starts app services, launches debuggers, and side-loads the Teams app. You can preview your Teams app in Teams web client locally after debugging. You need to set up Teams Toolkit before you debug your app.
-* [Start debugging](#start-debugging)
-* [Multi-target debugging](#multi-target-debugging)
-* [Toggle breakpoints](#toggle-breakpoints)
-* [Hot reload](#hot-reload)
-* [Stop debugging](#stop-debugging)
+## Set up your Teams Toolkit for debugging
-During the debug process, Teams Toolkit automatically starts app services, launches debuggers, and sideloads the Teams app. The Teams app is available for preview in Teams web client locally after debugging. You can also customize debug settings to use your bot endpoints, development certificate, or debug partial component to load your configured app.
-
-## Prerequisite
-
-Install the [latest version of Teams Toolkit](https://marketplace.visualstudio.com/items?itemName=TeamsDevApp.ms-teams-vscode-extension).
-
-## Key features of Teams Toolkit
-
-The following list provides the key features of Teams Toolkit:
-
-### Start debugging
-
-You can perform single operation, press **F5** to start debugging. The Teams Toolkit starts to check prerequisites, registers Azure AD app, Teams app, and registers bot, starts services, and launches browser.
-
-### Multi-target debugging
-
-Teams Toolkit utilizes multi-target debugging feature to debug tab, bot, message extension, and Azure Functions at the same time.
-
-### Toggle breakpoints
-
-You can toggle breakpoints on the source codes of tabs, bots, message extensions, and Azure Functions. The breakpoints execute when you interact with the Teams app in a web browser. The following image shows the toggle breakpoints:
-
- :::image type="content" source="../assets/images/teams-toolkit-v2/debug/toggle-points.png" alt-text="toggle breakpoints":::
-
-### Hot reload
-
-You can update and save the source codes of tab, bot, message extension, and Azure Functions at the same time when you are debugging the Teams app. The app reloads and the debugger reattaches to the programming languages.
-
- :::image type="content" source="../assets/images/teams-toolkit-v2/debug/hot-reload.png" alt-text="hot-reload for source codes":::
-
-### Stop debugging
-
-When you complete local debug, you can select **Stop** or **Disconnect** from the floating debugging toolbar to stop all debug sessions and terminate tasks. The following image shows the stop debug action:
-
- :::image type="content" source="../assets/images/teams-toolkit-v2/debug/stop-debug.png" alt-text="stop debugging":::
-
-## Debug your app locally
-
-The following steps help you to debug your Teams app locally:
-
-### Set up your Teams Toolkit
-
-Perform the following steps to debug your app after you create a new app using the Teams Toolkit:
+The following steps help you to set up your Teams Toolkit before you initiate the debug process:
# [Windows](#tab/Windows)
-1. Select **Debug Edge** or **Debug Chrome** from the **Run and Debug** in the activity bar.
+1. Select **Debug (Edge)** or **Debug (Chrome)** in the activity bar from the **RUN AND DEBUG Γû╖** drop down.
:::image type="content" source="../assets/images/teams-toolkit-v2/debug/debug-run.png" alt-text="Browser option":::
-1. Select **Start Debugging (F5)** or **Run** to run your Teams app in debug mode.
+1. Select **Run** > **Start Debugging (F5)**.
:::image type="content" source="../assets/images/teams-toolkit-v2/debug/start-debugging.png" alt-text="Start debugging":::
Perform the following steps to debug your app after you create a new app using t
:::image type="content" source="../assets/images/teams-toolkit-v2/debug/microsoft365-signin.png" alt-text="Sign in"::: > [!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.
+ > 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 with your credentials.
4. Select **Install** to install the development certificate for localhost.
Perform the following steps to debug your app after you create a new app using t
> [!TIP] > You can select **Learn More** to know about the development certificate.
-5. Select **Yes** if the following dialog box appears:
+5. Select **Yes** in the **Security Warning** dialog box appears:
:::image type="content" source="../assets/images/teams-toolkit-v2/debug/development-certificate.png" alt-text="certification authority":::
Toolkit launches a new Edge or Chrome browser instance based on your selection a
# [macOS](#tab/macOS)
-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 Γû╖** drop down.
:::image type="content" source="../assets/images/teams-toolkit-v2/debug/debug-run.png" alt-text="Browser lists":::
Toolkit launches a new Edge or Chrome browser instance based on your selection a
> [!TIP] > You can select **Learn More** to know about the development certificate.
-5. Enter your **User Name** and **Password**, then select **Update Settings** in the following dialog box:
+5. Enter your **User Name** and **Password**, then select **Update Settings**.
:::image type="content" source="../assets/images/teams-toolkit-v2/debug/mac-settings.png" alt-text="mac sign in":::
-Toolkit launches a new Edge or Chrome browser instance depending on your selection and opens a web page to load Teams client.
+Teams Toolkit launches your browser instance and opens a web page to load Teams client.
-### Debug your app
+## Debug your app
-After the initial set up process, the Teams Toolkit starts the following processes:
+After the initial set up process, Teams Toolkit starts the following processes:
-<br>
+* [Starts app services](#starts-app-services)
+* [Launches debug configurations](#launches-debug-configurations)
+* [Sideloads the Teams app](#sideloads-the-teams-app)
-<details>
-<summary><b>Starts app services</b></summary>
+### Starts app services
-Runs the tasks defined in `.vscode/tasks.json` as follows:
+Runs tasks as defined in `.vscode/tasks.json`.
| Component | Task name | Folder | | | | |
Runs the tasks defined in `.vscode/tasks.json` as follows:
| Bot or message extensions | **Start Bot** | bot | | 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 message extension, and Azure Functions.
+The following image displays task names in the **OUTPUT** and **TERMINAL** tabs of the Visual Studio Code while running tab, bot or message extension, and Azure Functions.
:::image type="content" source="../assets/images/teams-toolkit-v2/debug/Terminal.png" alt-text="Start app services":::
-</details>
-<details>
-<summary><b>Launches debuggers</b></summary>
+### Launches debug configurations
-Launches the debug configurations defined in `.vscode/launch.json` as follows:
+Launches the debug configurations as defined in `.vscode/launch.json`.
:::image type="content" source="../assets/images/teams-toolkit-v2/debug/launch-debuggers.png" alt-text="Launch debugger":::
-The following table lists the debug configuration names and types for project with tab app and bot app:
+The following table lists the debug configuration names and types for project with tab, bot or message extension app, and Azure Functions:
| Component | Debug configuration name | Debug configuration type | | | | |
The following table lists the debug configuration names and types for project wi
| Bot or message extensions | **Attach to Bot** | pwa-node | | Azure Functions | **Attach to Backend** | pwa-node |
-The following table lists the debug configuration names and types for project with bot app and without tab app:
+The following table lists the debug configuration names and types for project with bot app, Azure Functions and without tab app:
| Component | Debug configuration name | Debug configuration type | | | | |
The following table lists the debug configuration names and types for project wi
| Bot or message extension | **Attach to Bot** | pwa-node | | Azure Functions | **Attach to Backend** | pwa-node |
-</details>
-<details>
-<summary><b>Sideloads the Teams app</b></summary>
+### Sideloads the Teams app
-The configuration **Attach to Frontend** or **Launch Bot** launches a new Edge or Chrome browser instance and opens a web page to load Teams client. After the Teams client is loaded, Teams sideloads the Teams app controlled by the sideloading URL defined in the launch configurations [Microsoft Teams](https://teams.microsoft.com/l/app/>${localTeamsAppId}?installAppPackage=true&webjoin=true&${account-hint}). When Teams client loads in the web browser, select **Add** or select one from the dropdown list as per your requirement.
+The configuration **Attach to Frontend** or **Launch Bot** launches a Edge or Chrome browser instance to load Teams client in web page. After the Teams client is loaded, Teams side-loads the Teams app that is controlled by the sideloading URL defined in the launch configurations [Microsoft Teams](https://teams.microsoft.com/l/app/>${localTeamsAppId}?installAppPackage=true&webjoin=true&${account-hint}). When Teams client loads in the web browser, then select **Add** or select an option from the dropdown as per your requirement.
- :::image type="content" source="../assets/images/teams-toolkit-v2/debug/hello-local-debug.png" alt-text="local debug":::
+ :::image type="content" source="../assets/images/teams-toolkit-v2/debug/hello-local-debug.png" alt-text="Add local debug" lightbox="../assets/images/teams-toolkit-v2/debug/hello-local-debug.png":::
Your app is added to Teams!
-</details>
-
-## Customize debug settings
-
-Teams Toolkit unchecks some prerequisites and allows you to customize the debug settings to create your tab or bot:
-
-<br>
-
-<details>
-<summary><b>Use your bot endpoint</b></summary>
-
-1. In Visual Studio Code settings, clear **Ensure Ngrok is installed and started (ngrok)**.
-
-1. Set `siteEndpoint` configuration in `.fx/configs/config.local.json` to your endpoint.
-
-```json
-{
- "bot": {
- "siteEndpoint": "https://your-bot-tunneling-url"
- }
-}
-
-```
--
-</details>
-
-<details>
-<summary><b>Use your development certificate</b></summary>
-
-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.
-
-```json
-{
- "frontend": {
- "sslCertFile": "",
- "sslKeyFile": ""
- }
-}
-```
--
-</details>
-
-<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 bot or message 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.
-
- > [!NOTE]
- > Currently, the tab, bot, message extension apps, and Azure Functions ports don't support customization.
-
-</details>
-
-<details>
-<summary><b>Add environment variables</b></summary>
-
-You can add environment variables to `.env.teamsfx.local` file for tab, bot, message extension, and Azure Functions. Teams Toolkit loads the environment variables you added to start services during local debug.
-
- > [!NOTE]
- > Ensure to start a new local debug after you add new environment variables as the environment variables don't support hot reload.
-
-</details>
-
-<details>
-<summary><b>Debug partial component</b></summary>
-
-Teams Toolkit utilizes Visual Studio Code multi-target debugging to debug tab, bot, message extension, and Azure Functions at the same time. You can update `.vscode/launch.json` and `.vscode/tasks.json` to debug partial component. If you want to debug tab only in a tab plus bot with Azure Functions project, use the following steps:
-
-1. Comment **Attach to Bot** and **Attach to Backend** from debug compound in `.vscode/launch.json`.
-
- ```json
- {
- "name": "Debug (Edge)",
- "configurations": [
- "Attach to Frontend (Edge)",
- // "Attach to Bot",
- // "Attach to Backend""
- ],
- "preLaunchTask": "Pre Debug Check & Start All",
- "presentation": {
- "group": "all",
- "order": 1
- },
- "stopAll": true
-
- }
- ```
-
-2. Comment **Start Backend** and Start Bot from Start All task in .vscode/tasks.json.
-
- ```json
- {
-
- "label": "Start All",
- "dependsOn": [
- "Start Frontend",
- // "Start Backend",
- // "Start Bot"
-
- ]
-
- }
- ```
-
-</details>
-
-## Next step
+## Next
> [!div class="nextstepaction"]
-> [Debug background process](debug-background-process.md).
+> [Debug background processes](debug-background-process.md)
## See also
platform Debug Overview https://github.com/MicrosoftDocs/msteams-docs/commits/main/msteams-platform/toolkit/debug-overview.md
+
+ Title: Debug your Teams app
+
+description: In this module, learn how to debug your Teams app in Teams Toolkit and key features of Teams Toolkit
+
+ms.localizationpriority: high
+ Last updated : 03/21/2022++
+# Debug your Microsoft Teams app
+
+Microsoft Teams Toolkit helps you to debug and preview your Teams app. Debug is the process of checking, detecting, and correcting issues or bugs to ensure the program runs successfully in Teams.
+
+During the debug process:
+
+* Teams Toolkit automatically starts app services, launches debuggers, and sideloads the Teams app.
+* Teams Toolkit checks the prerequisites during the debug background process.
+* Your Teams app is available for preview in Teams web client locally after debugging.
+* You can also customize debug settings to use your bot endpoints, development certificate, or debug partial component to load your configured app.
+* Microsoft Visual Studio Code allows you to debug tab, bot, message extension, and Azure Functions.
+
+## Key debug features of Teams Toolkit
+
+Teams Toolkit supports the following debug features:
+
+* [Start debugging](#start-debugging)
+* [Multi-target debugging](#multi-target-debugging)
+* [Toggle breakpoints](#toggle-breakpoints)
+* [Hot reload](#hot-reload)
+* [Stop debugging](#stop-debugging)
+
+Teams Toolkit performs background functions during debug process, which include verifying the prerequisites required for debug.You can see the progress of the verification process in the output channel of Teams Toolkit. In the setup process you can register and configure your Teams app.
+
+### Start debugging
+
+You can press **F5** as a single operation to start debugging. The Teams Toolkit starts to check prerequisites, registers Azure AD app, Teams app, and registers bot, starts services, and launches browser.
+
+### Multi-target debugging
+
+Teams Toolkit utilizes multi-target debugging feature to debug tab, bot, message extension, and Azure Functions at the same time.
+
+### Toggle breakpoints
+
+You can toggle breakpoints on the source codes of tabs, bots, message extensions, and Azure Functions. The breakpoints execute when you interact with the Teams app in a web browser. The following image shows toggle breakpoint:
+
+ :::image type="content" source="../assets/images/teams-toolkit-v2/debug/toggle-points.png" alt-text="toggle breakpoints" lightbox="../assets/images/teams-toolkit-v2/debug/toggle-points.png":::
+
+### Hot reload
+
+You can update and save the source codes of tab, bot, message extension, and Azure Functions at the same time when you're debugging the Teams app. The app reloads and the debugger reattaches to the programming languages.
+
+ :::image type="content" source="../assets/images/teams-toolkit-v2/debug/hot-reload.png" alt-text="hot-reload for source codes" lightbox="../assets/images/teams-toolkit-v2/debug/hot-reload.png":::
+
+### Stop debugging
+
+When you complete local debug, you can select **Stop (Shift+F5)** or **[Alt] Disconnect (Shift+F5)** from the floating debugging toolbar to stop all debug sessions and terminate tasks. The following image shows the stop debug action:
+
+ :::image type="content" source="../assets/images/teams-toolkit-v2/debug/stop-debug.png" alt-text="stop debugging":::
+
+## Prepare for debug
+
+The following steps help you to prepare for debug:
+
+### Sign in to Microsoft 365
+
+If you've signed up for Microsoft 365 already, sign in to Microsoft 365. For more information, see [Microsoft 365 developer program](tools-prerequisites.md#microsoft-365-developer-program)
+
+### Toggle breakpoints
+
+Ensure that you can toggle breakpoints on the source codes of tabs, bots, message extensions, and Azure Functions for more information, see [Toggle breakpoints](#toggle-breakpoints)
+
+## Customize debug settings
+
+Teams Toolkit unchecks some prerequisites and allows you to customize the debug settings to create your tab or bot:
+
+<br>
+
+<details>
+<summary><b>Use your bot endpoint</b></summary>
+
+1. In Visual Studio Code settings, you need to uncheck **Ensure Ngrok is installed and started (ngrok)**.
+
+1. You can set `siteEndpoint` configuration in `.fx/configs/config.local.json` to your endpoint.
+
+```json
+{
+ "bot": {
+ "siteEndpoint": "https://your-bot-tunneling-url"
+ }
+}
+
+```
++
+</details>
+
+<details>
+<summary><b>Use your development certificate</b></summary>
+
+1. In Visual Studio Code settings, you need to uncheck **Ensure development certificate is trusted (devCert)**.
+
+1. You can set `sslCertFile` and `sslKeyFile` configuration in `.fx/configs/config.local.json` to your certificate file path and key file path.
+
+```json
+{
+ "frontend": {
+ "sslCertFile": "",
+ "sslKeyFile": ""
+ }
+}
+```
++
+</details>
+
+<details>
+<summary><b>Use your start scripts to start app services</b></summary>
+
+1. For tab, you need to update `dev:teamsfx` script in `tabs/package.json`.
+
+1. For bot or message extension, you need to update `dev:teamsfx` script in `bot/package.json`.
+
+1. For Azure Functions, you need to update `dev:teamsfx` script in `api/package.json` and for TypeScript update `watch:teamsfx` script.
+
+ > [!NOTE]
+ > Currently, the tab, bot, message extension apps, and Azure Functions ports don't support customization.
+
+</details>
+
+<details>
+<summary><b>Add environment variables</b></summary>
+
+You can add environment variables to `.env.teamsfx.local` file for tab, bot, message extension, and Azure Functions. Teams Toolkit loads the environment variables you added to start services during local debug.
+
+ > [!NOTE]
+ > Ensure to start a new local debug after you add new environment variables as the environment variables don't support hot reload.
+
+</details>
+
+<details>
+<summary><b>Debug partial component</b></summary>
+
+Teams Toolkit utilizes Visual Studio Code multi-target debugging to debug tab, bot, message extension, and Azure Functions at the same time. You can update `.vscode/launch.json` and `.vscode/tasks.json` to debug partial component. If you want to debug tab only in a tab plus bot with Azure Functions project, use the following steps:
+
+1. Comment **`Attach to Bot`** and **`Attach to Backend`** from debug compound in `.vscode/launch.json`.
+
+ ```json
+ {
+ "name": "Debug (Edge)",
+ "configurations": [
+ "Attach to Frontend (Edge)",
+ // "Attach to Bot",
+ // "Attach to Backend""
+ ],
+ "preLaunchTask": "Pre Debug Check & Start All",
+ "presentation": {
+ "group": "all",
+ "order": 1
+ },
+ "stopAll": true
+
+ }
+ ```
+
+2. Comment **`Start Backend`** and Start Bot from Start All task in .vscode/tasks.json.
+
+ ```json
+ {
+
+ "label": "Start All",
+ "dependsOn": [
+ "Start Frontend",
+ // "Start Backend",
+ // "Start Bot"
+
+ ]
+
+ }
+ ```
+
+</details>
+
+## Next
+
+> [!div class="nextstepaction"]
+> [Debug your app locally](debug-local.md)
+
+## See also
+
+* [Debug background process](debug-background-process.md)
+* [Use Teams Toolkit to provision cloud resources](provision.md)
+* [Deploy to the cloud](deploy.md)
+* [Preview and customize Teams app manifest](TeamsFx-preview-and-customize-app-manifest.md)
platform Deploy https://github.com/MicrosoftDocs/msteams-docs/commits/main/msteams-platform/toolkit/deploy.md
Last updated 11/29/2021
# Deploy Teams app to the cloud
-Teams Toolkit helps you to deploy or upload the frontend and backend code in your application to your provisioned cloud resources in Azure.
+Teams Toolkit helps you to deploy or upload the frontend and backend code in your application to your provisioned cloud resources in Azure. You can deploy the following to the cloud:
* The tab, such as frontend applications are deployed to Azure storage and configured for static web hosting or a sharepoint site. * The backend APIs are deployed to Azure functions. * The bot or message extension is deployed to Azure app service.
-## Prerequisite
-
-* [Install Teams Toolkit](https://marketplace.visualstudio.com/items?itemName=TeamsDevApp.ms-teams-vscode-extension) version v3.0.0+.
-
-> [!NOTE]
->
-> * Ensure you have Teams app project opened in VS code.
-> * Before you deploy project code to cloud, [provision the cloud resources](provision.md).
+ > [!NOTE]
+ > Before you deploy app code to Azure cloud, you need to successfully complete the [provisioning of cloud resources](provision.md).
## Deploy Teams apps using Teams Toolkit
-The get started guides help you to deploy using Teams Toolkit. You can use the following to deploy your Teams app:
+The Get started guides help you to deploy using Teams Toolkit. You can use the following to deploy your Teams app:
* [Deploy your app to Azure](/microsoftteams/platform/sbs-gs-javascript?tabs=vscode%2Cvsc%2Cviscode%2Cvcode&tutorial-step=8&branch) * [Deploy your app to SharePoint](/microsoftteams/platform/sbs-gs-spfx?tabs=vscode%2Cviscode&tutorial-step=4&branch)
The get started guides help you to deploy using Teams Toolkit. You can use the f
|Bots and message extensions </br> The backend workload | `yourProjectFolder/bot` | Not applicable | Azure app service | > [!NOTE]
-> When you include Azure API management resource in your project and trigger deploy. You can publish your APIs in Azure functions to Azure API management service.
+> When you include Azure API management resource in your project and trigger deploy, you can publish your APIs in Azure functions to Azure API management service.
## See also
-* [Add more cloud resources](add-resource.md)
* [Create and deploy an Azure cloud service](/azure/cloud-services/cloud-services-how-to-create-deploy-portal)
-* [Add more Teams app capabilities](add-capability.md)
-* [Deploy project code with CI/CD pipelines](use-CICD-template.md)
-* [Manage multiple environments](TeamsFx-multi-env.md)
-* [Collaborate with other developers on Teams project](TeamsFx-collaboration.md)
+* [Create multi-capability Teams apps](add-capability.md)
+* [Add cloud resources to Microsoft Teams app](add-resource.md)
platform Explore Teams Toolkit https://github.com/MicrosoftDocs/msteams-docs/commits/main/msteams-platform/toolkit/explore-Teams-Toolkit.md
+
+ Title: Explore Teams Toolkit
+
+description: In this module, learn on exploring Teams Toolkit
+
+ms.localizationpriority: medium
+ Last updated : 07/29/2022++
+# Explore Teams Toolkit
+
+In this document you can understand different UI elements along with description and basic usage in Teams Toolkit.
+
+## Teams Toolkit basic UI elements
+
+After Teams Toolkit installation, you'll see the Teams Toolkit UI as shown in the following image:
++
+| Serial No | UI Elements | Definition |
+| | |
+| 1 | **Get Started** | Explore Teams Toolkit. |
+| &nbsp; | **Tutorials** | Access different tutorials. |
+| &nbsp; | **Documentation** | Access the Microsoft Teams Developer Documentation. |
+| 2 | **Create a new Teams App** | Create a new Teams app based on your requirement. |
+| 3 | **View Samples** | Build different types of app based on existing samples. |
+| 4 | **Open Folder** | Open the existing Teams app. |
+| 5 | **New File** | Create new file. |
+| &nbsp; | **Open File** | Open the existing file. |
+| &nbsp; | **Open Folder** | Open the existing folder. |
+| 6 | **Recent** | View the recent files. |
+
+### Exploring the Teams Toolkit task pane
+
+You can explore more UI elements from task pane in Teams Toolkit. Task pane is visible only after creating an app using Teams Toolkit. The following video helps you to know about the process of creating new Teams app and after this process you can view the task pane in Teams Toolkit.
+
+ ![Create a Teams app](~/assets/videos/javascript-tab-app1.gif)
+
+After creating a new Teams app, you can see the directory structure of the app in the left panel and the readme file in the right panel.
++
+Let's take a tour of the Teams Toolkit UI.
+
+ In Visual Studio Code toolbar, The following icons are relevant to the Teams Toolkit:
+
+| Icon | Description |
+| | |
+| **Explorer** :::image type="icon" source="../assets/images/teams-toolkit-v2/file-explorer-icon.PNG"::: | To view the directory structure of the app. |
+| **Run and Debug** :::image type="icon" source="../assets/images/teams-toolkit-v2/run-debug-icon.PNG"::: | To start the local or remote debug process. |
+| **Teams Toolkit** :::image type="icon" source="../assets/images/teams-toolkit-v2/teams-toolkit-sidebar-icon.PNG"::: | To view the task pane in Teams Toolkit. |
+
+From the task pane you can see the following sections:
+
+ :::column span="":::
+ :::image type="content" source="../assets/images/teams-toolkit-v2/teams toolkit fundamentals/accounts1.png" alt-text="accounts section":::
+ :::column-end:::
+ :::column span="":::
+
+ To develop a Teams app, you need the following accounts:
+
+ * **Sign in to M365**: Use your Microsoft 365 account with a valid E5 subscription for building your app.
+
+ * **Sign in to Azure**: Use your Azure account for deploying app on Azure. You can [create a free Azure account](https://azure.microsoft.com/free/) before you start.
+ :::column-end:::
+
+ :::column span="":::
+ :::image type="content" source="../assets/images/teams-toolkit-v2/teams toolkit fundamentals/environment1.png" alt-text="Environment section":::
+ :::column-end:::
+ :::column span="":::
+
+ To deploy your Teams app, you need the following environments:
+
+ * **local**: Deploy your app in the default local environment with local machine environment configurations.
+
+ * **dev**: Deploy your app in the default dev environment with remote or cloud environment configurations. You can create more environments, as you need.
+ :::column-end:::
+
+ :::column span="":::
+ :::image type="content" source="../assets/images/teams-toolkit-v2/teams toolkit fundamentals/development.png" alt-text="Development section":::
+ :::column-end:::
+ :::column span="":::
+
+ To create and customize your Teams app, you need the following features:
+
+ * **Create a new Teams app**: Use the toolkit wizard to prepare project scaffolding for app development.
+
+ * **View samples**: Select any of Teams Toolkit's sample apps. The toolkit downloads the app code from GitHub, and you can build the sample app.
+
+ * **Add features**: Add other required Teams capabilities to Teams app during development process and add optional cloud resources suitable for your app.
+
+ * **Edit manifest file**: Edit the Teams app integration with Teams client.
+ :::column-end:::
+
+ :::column span="":::
+ :::image type="content" source="../assets/images/teams-toolkit-v2/teams toolkit fundamentals/deployment1.png" alt-text="Deployment section":::
+ :::column-end:::
+ :::column span="":::
+
+ To provision, deploy and publish your Teams app, you need the following features:
+
+ * **Provision in the cloud**: Allocate Azure resources for your application. Teams Toolkit is integrated with Azure Resource Manager.
+
+ * **Zip Teams metadata package**: Create the app package that can be uploaded to Teams or Developer Portal. It contains the app manifest and app icons.
+
+ * **Deploy to the cloud**: Deploy the source code to Azure.
+
+ * **Publish to Teams**: Publish your developed app and distribute it to scopes, such as personal, team, channel, or organization.
+
+ * **Developer Portal for Teams**: Use Developer Portal to configure and manage your Teams app.
+ :::column-end:::
+
+ :::column span="":::
+ :::image type="content" source="../assets/images/teams-toolkit-v2/teams toolkit fundamentals/help-and-feedback1.png" alt-text="Help and feedback section":::
+ :::column-end:::
+ :::column span="":::
+
+ To access more information on Teams Toolkit. you need the following documentation and resources.
+
+ * **Get started**: View the Teams Toolkit Get started help within Visual Studio Code.
+
+ * **Tutorials**: Select to access different tutorials.
+
+ * **Documentation**: Select to access the Microsoft Teams Developer Documentation.
+
+ * **Report issues on GitHub**: Select to access GitHub page and raise any issues.
+ :::column-end:::
+
+## See also
+
+* [Install Teams Toolkit](install-Teams-Toolkit.md)
+* [Create a new Teams app using Teams Toolkit](create-new-project.md)
+* [Prepare to build apps using Microsoft Teams Toolkit](build-environments.md)
+* [Provision cloud resources using Teams Toolkit](provision.md)
+
+<!--
+
+|Section|Features|Details
+|||--|
+| **1. ACCOUNTS** | &nbsp; | &nbsp; |
+| &nbsp; |Microsoft 365 account| Use your Microsoft 365 account with a valid E5 subscription for building your app.|
+| &nbsp; | Azure Account | Use your Azure account for deploying app on Azure. You can [create a free Azure account](https://azure.microsoft.com/free/) before you start.|
+|**2.ENVIRONMENT** | &nbsp; | &nbsp;|
+| &nbsp; |Local |Deploy your app in the default local environment with local machine environment configurations.|
+| &nbsp; | Dev |Deploy your app in the default dev environment with remote or cloud environment configurations. You can create more environments, as you need.|
+| **3.DEVELOPMENT** | &nbsp; | &nbsp; |
+| &nbsp; | Create a new Teams app | Teams Toolkit helps you to create and customize your Teams app project that makes the Teams app development work simpler. Create a new Teams app helps you to start with Teams app development by creating new Teams project using Teams Toolkit either by using **Create new project**|
+| &nbsp; | View Samples | Select any of Teams Toolkit's sample apps. The toolkit downloads the app code from GitHub, and you can build the sample app.|
+| &nbsp; | Add Features | It helps you to add additional Teams capabilities such as **Tab** or **Bot** or **Message extension** or **Command bot** or **Notification bot**, or **SSO enabled tab** optionally add Azure resources such as **Azure SQL Database** or **Azure Key Vault**, or **Azure function** or **Azure API Management** which fits your development needs to your current Teams app. You can also add **API connection** or **Single Sign-on** or **CI/CD workflows** for your Teams app.
+| &nbsp; | Edit Manifest file | It helps you customize manifest file based on the app requirements |
+| **4.DEPLOYMENT** | &nbsp; | &nbsp; |
+| &nbsp;| Provision in the cloud | Allocate Azure resources for your application. Teams Toolkit is integrated with Azure Resource Manager.|
+| &nbsp; | Zip Teams metadata package| Create the app package that can be uploaded to Teams or Developer Portal. It contains the app manifest and app icons. |
+| &nbsp; | Deploy to the cloud| Deploy the source code to Azure.|
+| &nbsp; | Publish to Teams| Publish your developed app and distribute it to scopes, such as personal, team, channel, or organization.|
+| &nbsp; | Developer Portal for Teams| It is the primary tool for configuring, distributing, and managing your Microsoft Teams apps. You can collaborate with colleagues on your app, set up runtime environments, and much more. |
+| **5.HELP AND FEEDBACK** | &nbsp; | &nbsp; |
+| &nbsp; | Get Started | View the Teams Toolkit Get started help within Visual Studio Code.|
+| &nbsp; | Tutorials| Select to access different tutorials.|
+| &nbsp; | Documentation| Select to access the Microsoft Teams Developer Documentation.|
+| &nbsp; | Report issues on GitHub| It helps to get **Quick support** from product expert. Browse the existing issues before you create a new one, or visit [StackOverflow tag `teams-toolkit`](https://stackoverflow.com/questions/tagged/teams-toolkit) to submit feedback.|
+| **6.Explorer** | &nbsp; | &nbsp; |
+ &nbsp; | &nbsp; | It helps to view the directory structure of your app.|
+| **7.Run and Debug** | &nbsp; | &nbsp; |
+ &nbsp; | &nbsp; | To start the local or remote debug process.|
+-->
platform Faq https://github.com/MicrosoftDocs/msteams-docs/commits/main/msteams-platform/toolkit/faq.md
+
+ Title: FAQ
+
+description: In this module, See FAQ for Teams Toolkit using Visual Studio Code
+
+ms.localizationpriority: medium
+ Last updated : 11/29/2021++
+# FAQ for Teams Toolkit using Visual Studio Code
+
+You can see the FAQ for all the sections of Teams Toolkit for Visual Studio Code.
+
+FAQ for [Provision cloud resources using Teams Toolkit](provision.md)
+
+<br>
+
+<details>
+
+<summary><b>How to troubleshoot?</b></summary>
+
+If you get errors with Teams Toolkit in Visual Studio Code, you can select **Get Help** on the error notification to navigate to the related document. If you're using TeamsFx CLI, there will be a hyperlink at the end of error message that points to the help doc. You can also view [provision help doc](https://aka.ms/teamsfx-arm-help) directly.
+
+<br>
+
+</details>
+
+<details>
+
+<summary><b>How can I switch to another Azure subscription while provisioning?</b></summary>
+
+1. Switch subscription in current account or log out and select a new subscription.
+2. If you have already provisioned current environment, you need to create a new environment and perform provision because ARM doesn't support moving resources.
+3. If you didn't provision current environment, you can trigger provision directly.
+
+<br>
+
+</details>
+
+<details>
+
+<summary><b>How can I change resource group while provisioning?</b></summary>
+
+Before provision, the tool asks you if you want to create a new resource group or use an existing one. You can provide a new resource group name or choose an existing one in this step.
+
+<br>
+
+</details>
+
+<details>
+
+<summary><b>How can I provision sharepoint-based app?</b></summary>
+
+You can follow [provision SharePoint-based app](/microsoftteams/platform/sbs-gs-spfx?tabs=vscode%2Cviscode&tutorial-step=4).
+
+> [!NOTE]
+> Currently, the building Teams app with sharepoint framework with Teams Toolkit doesn't have direct integration with Azure, the contents in the doc doesn't apply to SPFx based apps.
+
+<br>
+
+</details>
platform Install Teams Toolkit https://github.com/MicrosoftDocs/msteams-docs/commits/main/msteams-platform/toolkit/install-Teams-Toolkit.md
+
+ Title: Install Teams Toolkit
+
+description: In this module, learn Installation of Teams Toolkit
+
+ms.localizationpriority: medium
+ Last updated : 07/29/2022++
+# Install Teams Toolkit
+
+Teams Toolkit is an extension in Visual Studio Code. In this document you can learn, how to install Teams Toolkit. Before you start with installation, you need to have Visual Studio Code and Teams client installed.
+
+## Steps to install Teams Toolkit
+
+You can install Teams Toolkit from an extension in Visual Studio Code and from Visual Studio Code Marketplace. The following steps help you to install Teams Toolkit:
+
+# [Visual Studio Code](#tab/vscode)
+
+1. Open **Visual Studio Code**.
+1. Select the Extensions view (**Ctrl+Shift+X** / **⌘⇧-X** or **View > Extensions**).
+
+ :::image type="content" source="../assets/images/teams-toolkit-v2/teams toolkit fundamentals/install toolkit-1.png" alt-text="install":::
+
+1. Enter **Teams Toolkit** in the search box.
+
+ :::image type="content" source="../assets/images/teams-toolkit-v2/teams toolkit fundamentals/install-toolkit2.png" alt-text="Toolkit":::
+
+1. Select **Install**.
+
+ :::image type="content" source="../assets/images/teams-toolkit-v2/teams toolkit fundamentals/select-install-ttk.png" alt-text="install toolkit 4.0.0":::
+
+ After successful installation of Teams Toolkit in Visual Studio Code, Teams Toolkit icon appears in the Visual Studio Code toolbar.
+
+ :::image type="content" source="../assets/images/teams-toolkit-v2/teams toolkit fundamentals/after-install.png" alt-text="After install":::
+
+# [Marketplace](#tab/marketplace)
+
+1. Open [Visual Studio Code Marketplace](https://marketplace.visualstudio.com/items?itemName=TeamsDevApp.ms-teams-vscode-extension).
+
+ The following page appears.
+
+ :::image type="content" source="../assets/images/teams-toolkit-v2/teams toolkit fundamentals/install-ttk-marketplace.png" alt-text="install TTK Marketplace":::
+
+1. Select **Install**.
+
+ :::image type="content" source="../assets/images/teams-toolkit-v2/teams toolkit fundamentals/Install-ttk.png" alt-text="install TTK":::
+
+1. From the pop-up window, select **Open**.
+
+ :::image type="content" source="../assets/images/teams-toolkit-v2/teams toolkit fundamentals/select-open.png" alt-text="Select the open":::
+
+ The following Visual Studio Code page appears.
+
+ :::image type="content" source="../assets/images/teams-toolkit-v2/teams toolkit fundamentals/ttk-in-vsc.png" alt-text="Select TTK in VSC":::
+
+1. Select **Install**.
+
+ :::image type="content" source="../assets/images/teams-toolkit-v2/teams toolkit fundamentals/select-install-ttk.png" alt-text="Select Install TTK in VSC":::
+
+ After successful installation of Teams Toolkit in Visual Studio Code, Teams Toolkit icon appears in the Visual Studio Code toolbar.
+
+ :::image type="content" source="../assets/images/teams-toolkit-v2/teams toolkit fundamentals/after-install.png" alt-text="After install":::
+++
+#### Upgrade Teams Toolkit
+
+Teams Toolkit is upgraded to the latest version by default. The following steps help you to install different version:
+
+* Select the Extensions :::image type="icon" source="../assets/images/teams-toolkit-v2/extension icon.PNG"::: icon.
+* Enter **Teams Toolkit** in the search box.
+* In Teams Toolkit extension, select :::image type="icon" source="../assets/images/teams-toolkit-v2/setting icon.PNG"::: icon.
+* Select **Install Another Version** for upgrade to the latest version of Teams Toolkit.
+
+## See also
+
+* [Explore Teams Toolkit](explore-Teams-Toolkit.md)
+* [Create a new Teams app using Teams Toolkit](create-new-project.md)
+* [Prepare to build apps using Microsoft Teams Toolkit](build-environments.md)
+* [Provision cloud resources using Teams Toolkit](provision.md)
+* [Deploy Teams app to the cloud](deploy.md)
platform Provision https://github.com/MicrosoftDocs/msteams-docs/commits/main/msteams-platform/toolkit/provision.md
Last updated 11/29/2021
-# Provision cloud resources using Teams Toolkit
+# Provision cloud resources
TeamsFx integrates with Azure and Microsoft 365 cloud, which allows you to place your application in Azure with a single command. TeamsFx integrates with Azure Resource Manager that enables you to provision Azure resources, which your application needs for code approach.
-## Prerequisites
-
-* Account prerequisites
- To provision cloud resources, you must have the following accounts:
-
- * Microsoft 365 account with valid subscription.
- * Azure with valid subscription.
- For more information, see [how to prepare accounts for building Teams app](accounts.md).
-
-* [Install Teams Toolkit](https://marketplace.visualstudio.com/items?itemName=TeamsDevApp.ms-teams-vscode-extension) version v3.0.0+.
-
-> [!TIP]
-> Ensure you have Teams app project opened in VS code.
- ## Provision using Teams Toolkit
-Provision is performed with single command in Teams Toolkit for Visual Studio Code or TeamsFx CLI as follows:
+Provision is performed with single command in Teams Toolkit for Visual Studio Code or TeamsFx CLI. For more information, see [Provision Azure-based app](/microsoftteams/platform/sbs-gs-javascript?tabs=vscode%2Cvsc%2Cviscode%2Cvcode&tutorial-step=8)
-[Provision Azure-based app](/microsoftteams/platform/sbs-gs-javascript?tabs=vscode%2Cvsc%2Cviscode%2Cvcode&tutorial-step=8)
-
-## Resource creation
+## Create Resources
When you trigger provision command in Teams Toolkit or TeamsFx CLI, you can get the following resources:
When you create a new project, you can use all the Azure resources. The ARM temp
> [!NOTE] > Azure services incur costs in your subscription, for more information on cost estimation, see [the pricing calculator](https://azure.microsoft.com/pricing/calculator/).
-### Resource creation for Teams Tab application
+The following list shows the resource creation for different types of app and Azure resources:
+<br>
+
+<details>
+<summary><b>Resource creation for Teams Tab application</b></summary>
|Resource|Purpose|Description | |-|--|--|
When you create a new project, you can use all the Azure resources. The ARM temp
| Web app for simple auth | Host simple auth server to gain access to other services in your single page application | Adds user assigned identity to access other Azure resources | | User assigned identity | Authenticate Azure service-to-service requests | Shared across different capabilities and resources |
-### Resource creation for Teams bot or message extension application
+</details>
+<br>
+
+<details>
+<summary><b>Resource creation for Teams bot or message extension application</b></summary>
|Resource|Purpose| Description | |-|--|--|
When you create a new project, you can use all the Azure resources. The ARM temp
| Web app for bot | Host your bot app | Adds user assigned identity to access other Azure resources. <br /> Adds app settings required by [TeamsFx SDK](https://www.npmjs.com/package/@microsoft/teamsfx) | | User assigned identity | Authenticate Azure service-to-service requests | Shared across different capabilities and resources |
-### Resource creation for Azure Functions in the project
+</details>
+<br>
+
+<details>
+<summary><b>Resource creation for Azure Functions in the project</b></summary>
|Resource|Purpose| Description| |-|--|--|
When you create a new project, you can use all the Azure resources. The ARM temp
| Azure storage for function app | Required to create function app |Not applicable| | User assigned identity | Authenticate Azure service-to-service requests | Shared across different capabilities and resources |
-### Resource creation for Azure SQL in the project
+</details>
+<br>
+
+<details>
+<summary><b>Resource creation for Azure SQL in the project</b></summary>
|Resource|Purpose | Description | |-|--|--|
When you create a new project, you can use all the Azure resources. The ARM temp
| Azure SQL database | Store data for your app | Grants user assigned identity, read or write permission to the database | | User assigned identity | Authenticate Azure service-to-service requests | Shared across different capabilities and resources |
-### Resource creation for Azure API Management in the project
+</details>
+<br>
+
+<details>
+<summary><b>Resource creation for Azure API Management in the project</b></summary>
|Resource|Purpose| |-|--|
When you create a new project, you can use all the Azure resources. The ARM temp
| API management OAuth server | Enables Microsoft Power Platform to access your APIs hosted in function app | | User assigned identity | Authenticate Azure service-to-service requests |
-### Resources created when including Azure Key Vault in the project
+</details>
+<br>
+
+<details>
+<summary><b>Resources created when including Azure Key Vault in the project</b></summary>
|Resources|Purpose of this resource| |-|--| | Azure Key Vault Service | Manage secrets (e.g. Azure AD app client secret) used by other Azure Services | | User Assigned Identity | Authenticate Azure service-to-service requests |
+</details>
+<br>
+ ## Customize resource provision
-Teams Toolkit enables you to use an infrastructure as code approach to define what Azure resources you want to provision, and how you want to configure. The tool uses ARM template to define Azure resources. The ARM template is a set of bicep files that defines the infrastructure and configuration for your project. You can customize Azure resources by modifying the ARM template. For more information, see [bicep document](/azure/azure-resource-manager/bicep).
+Teams Toolkit enables you to use an infrastructure-as-code approach to define Azure resources that you want to provision, and how you want to configure. The tool uses ARM template to define Azure resources. The ARM template is a set of bicep files that defines the infrastructure and configuration for your project. You can customize Azure resources by modifying the ARM template. For more information, see [bicep document](/azure/azure-resource-manager/bicep).
Provision with ARM involves changing the following sets of files, parameters and templates:
Provision with ARM involves changing the following sets of files, parameters and
> [!NOTE] > When you add resources or capabilities to your project, `teamsfx/xxx.bicep` will be regenerated, you can't customize the same. To modify the bicep files, you can use Git to track your changes to `teamsfx/xxx.bicep` files, which helps you to not lose changes while adding resources or capabilities.
+### Azure AD parameters
+ The ARM template files use placeholders for parameters. The purpose of these placeholders is to ensure creation of new resources for you in new environment. The actual values are resolved from `.fx/states/state.{env}.json`.
+There are two types of parameters such as Azure AD application related parameters and Azure resource-related parameters.
+ ##### Azure AD application-related parameters | Parameter name | Default value place holder | Meaning of the place holder | How to customize | | | | | |
-| Microsoft 365 ClientId | {{state.fx-resource-aad-app-for-teams.clientId}} | Your app's Azure AD app client id created during provision | [Customize the value](#use-an-existing-azure-ad-app-for-your-teams-app) |
-| Microsoft 365 ClientSecret | {{state.fx-resource-aad-app-for-teams.clientSecret}} | Your app's Azure AD app client secret created during provision | [Customize the value](#use-an-existing-azure-ad-app-for-your-teams-app) |
-| Microsoft 365 TenantId | {{state.fx-resource-aad-app-for-teams.tenantId}} | Tenant Id of your app's Azure AD app | [Customize the value](#use-an-existing-azure-ad-app-for-your-teams-app) |
-| Microsoft 365 OAuthAuthorityHost | {{state.fx-resource-aad-app-for-teams.oauthHost}} | OAuth authority host of your app's Azure AD app | [Customize the value](#use-an-existing-azure-ad-app-for-your-teams-app) |
-| botAadAppClientId | {{state.fx-resource-bot.botId}} | Bot's Azure AD app client Id created during provision | [Customize the value](#use-an-existing-azure-ad-app-for-your-bot) |
-| botAadAppClientSecret | {{state.fx-resource-bot.botPassword}} | Bot's Azure AD app client secret created during provision | [Customize the value](#use-an-existing-azure-ad-app-for-your-bot) |
+| Microsoft 365 ClientId | {{state.fx-resource-aad-app-for-teams.clientId}} | Your app's Azure AD app client id created during provision | [Use an existing Azure AD app for your bot](#use-an-existing-azure-ad-app-for-your-bot) |
+| Microsoft 365 ClientSecret | {{state.fx-resource-aad-app-for-teams.clientSecret}} | Your app's Azure AD app client secret created during provision | [Use an existing Azure AD app for your Teams app](#use-an-existing-azure-ad-app-for-your-teams-app) |
+| Microsoft 365 TenantId | {{state.fx-resource-aad-app-for-teams.tenantId}} | Tenant Id of your app's Azure AD app | [Use an existing Azure AD app for your Teams app](#use-an-existing-azure-ad-app-for-your-teams-app) |
+| Microsoft 365 OAuthAuthorityHost | {{state.fx-resource-aad-app-for-teams.oauthHost}} | OAuth authority host of your app's Azure AD app | [Use an existing Azure AD app for your Teams app](#use-an-existing-azure-ad-app-for-your-teams-app) |
+| botAadAppClientId | {{state.fx-resource-bot.botId}} | Bot's Azure AD app client Id created during provision | [Use an existing Azure AD app for your bot](#use-an-existing-azure-ad-app-for-your-bot) |
+| botAadAppClientSecret | {{state.fx-resource-bot.botPassword}} | Bot's Azure AD app client secret created during provision | [Use an existing Azure AD app for your bot](#use-an-existing-azure-ad-app-for-your-bot) |
##### Azure resource-related parameters
The following steps are:
} ```
-### Scenerio
- To add other Azure resource or storage to the application:
-Consider the scenario, you want to add Azure storage to your Azure function backend to store blob data. There is no auto flow to update the bicep template with Azure storage support. However, you can edit the bicep file and add the resource. The steps are as follows:
+Consider the following scenario:
+
+You want to add Azure storage to your Azure function backend to store blob data. There is no auto flow to update the bicep template with Azure storage support. However, you can edit the bicep file and add the resource. The steps are as follows:
1. Create a tab project. 2. Add function to the project. For more information, see [add resources](./add-resource.md).
Consider the scenario, you want to add Azure storage to your Azure function back
5. You can update your function with Azure storage output bindings.
-## FAQ
-
-<br>
-
-<details>
-
-<summary><b>How to troubleshoot?</b></summary>
-
-If you get errors with Teams Toolkit in Visual Studio Code, you can select **Get Help** on the error notification to navigate to the related document. If you're using TeamsFx CLI, there will be a hyperlink at the end of error message that points to the help doc. You can also view [provision help doc](https://aka.ms/teamsfx-arm-help) directly.
-
-<br>
-
-</details>
-
-<details>
-
-<summary><b>How can I switch to another Azure subscription while provisioning?</b></summary>
-
-1. Switch subscription in current account or log out and select a new subscription.
-2. If you have already provisioned current environment, you need to create a new environment and perform provision because ARM doesn't support moving resources.
-3. If you didn't provision current environment, you can trigger provision directly.
-
-<br>
-
-</details>
-
-<details>
-
-<summary><b>How can I change resource group while provisioning?</b></summary>
-
-Before provision, the tool asks you if you want to create a new resource group or use an existing one. You can provide a new resource group name or choose an existing one in this step.
-
-<br>
-
-</details>
-
-<details>
-
-<summary><b>How can I provision sharepoint-based app?</b></summary>
-
-You can follow [provision SharePoint-based app](/microsoftteams/platform/sbs-gs-spfx?tabs=vscode%2Cviscode&tutorial-step=4).
-
-> [!NOTE]
-> Currently, the building Teams app with sharepoint framework with Teams Toolkit doesn't have direct integration with Azure, the contents in the doc doesn't apply to SPFx based apps.
-
-<br>
-
-</details>
- ## See also * [Deploy Teams app to the cloud](deploy.md)
platform Publish https://github.com/MicrosoftDocs/msteams-docs/commits/main/msteams-platform/toolkit/publish.md
Last updated 11/29/2021
# Publish Teams apps using Teams Toolkit
-After creating the app, you can distribute your app to different scope, such as individual, team, organization, or anyone. The distribution depends on multiple factors, including needs, business and technical requirements, and your goal for the app. Distribution to different scope may need different review process. In general, the bigger the scope, the more review the app needs to go through for security and compliance concerns.
+After creating the app, you can distribute your app to different scope, such as individual, team, organization, or anyone. The distribution depends on multiple factors such as needs, business and technical requirements, and your goal for the app. Distribution to different scope may need different review process. In general, the bigger the scope, the more review the app needs to go through for security and compliance concerns.
-## Prerequisite
-* [Install Teams Toolkit](https://marketplace.visualstudio.com/items?itemName=TeamsDevApp.ms-teams-vscode-extension) version v3.0.0+.
+Here's what you'll learn in this section:
-> [!TIP]
-> Ensure you have Teams app project in VS code.
+* [Publish to individual scope or sideload permission](#publish-to-individual-scope-or-sideload-permission)
+* [Publish to your organization](#publish-to-your-organization)
+* [Publish to Microsoft Teams store](#publish-to-microsoft-teams-store)
+
+## Prerequisites
+
+* Ensure to create your [app package](~/concepts/build-and-test/apps-package.md) and [validate it](https://dev.teams.microsoft.com/appvalidation.html) for errors.
+* [Enable custom app uploading](~/concepts/build-and-test/prepare-your-o365-tenant.md#enable-custom-teams-apps-and-turn-on-custom-app-uploading) in Teams.
+* Ensure that your app is running and accessible using HTTPs.
+* Ensure you have followed set of guidelines in the publish your app to the Microsoft Teams store to publish your app.
## Publish to individual scope or sideload permission
-The users can add custom app to Teams by uploading an app package in a *.zip file directly to a team or in personal context. Adding a custom app by uploading an app package is known as sideloading and allows you to test app while being developed, before the app is ready to be widely distributed as mentioned in the following scenarios:
+You can add custom app to Teams by uploading an [app package](../concepts/build-and-test/apps-package.md) in a *.zip file directly to a team or in personal context. Adding a custom app by uploading an app package is known as sideloading. It allows you to test app while being uploaded in Teams. You can build and test app in the following scenarios:
* Test and debug an app locally. * Build an app for yourself, such as to automate a workflow. * Build an app for small set of users, such as, your work group.
-You can build an app for internal use only and share it with your team without submitting it to the Teams app catalog in the Teams app store.
+You can build an app for internal use only and share it with your team without submitting it to the Teams app catalog in the Teams app store. For more information, see [Upload your app in Teams](../concepts/deploy-and-publish/apps-upload.md).
+
+### To build your app to zip app package file
-**To build your app to *.zip app package file**
+You need to run `Provision in the cloud` first before you build the app package. The following steps help you to build the app package.
-You can build the app package by selecting `Zip Teams metadata package` from **DEPLOYMENT** in Treeview of Teams Toolkit. You need to run `Provision in the cloud` first. The generated app package will be located in `{your project folder}/build/appPackage/appPackage.{env}.zip`.
+* Select **Zip Teams metadata package** under **DEPLOYMENT**.<br>
+ The generated app package will be located in `{your project folder}/build/appPackage/appPackage.{env}.zip`.
+
+### To upload app package
Perform the following steps to upload app package:
-1. In the Teams client, select **Apps** in left bar.
-2. Select **Manage your apps**.
-3. Select **publish an app**.
+1. In the Teams client, select **Apps** > **Manage your apps** > **upload an app**.
+
+ :::image type="content" source="../assets/images/teams-toolkit-v2/teams toolkit fundamentals/publish1.png" alt-text="publish an app":::
- :::image type="content" source="../assets/images/teams-toolkit-v2/teams toolkit fundamentals/pub.png" alt-text="publish":::
+ **Upload an app** window appears.
-4. Select **Upload a custom app**:
+2. Select **Upload a custom app**.
- :::image type="content" source="../assets/images/teams-toolkit-v2/teams toolkit fundamentals/uplo.png" alt-text="upload":::
+ :::image type="content" source="../assets/images/teams-toolkit-v2/teams toolkit fundamentals/upload.png" alt-text="upload an app":::
+
+ Now the app is sideloaded into the Teams client and you can add and view it.
## Publish to your organization
-When the app is ready for use in production, you can submit the app using the Teams app submission API, called from Graph API, an integrated development environment (IDE) such as Microsoft Visual Studio Code installed with Teams toolkit. You can either select **Publish to Teams** from **DEPLOYMENT** in TreeView of Teams Toolkit, or trigger **Teams: Publish to Teams** from command palette. Then select **Install for your organization**:
+When the app is ready for use in production, you can submit the app using the Teams app submission API, called from Graph API. Teams app submission API is an integrated development environment (IDE) such as Microsoft Visual Studio Code installed with Teams toolkit. The following steps help you to publish the app to your organization:
+
+* [Publish from Teams Toolkit](#publish-from-teams-toolkit)
+* [Approve on Admin Center](#approve-on-admin-center)
+
+### Publish from Teams Toolkit
+
+The following steps help you to publish the app from Teams Toolkit:
+
+1. You can publish your Teams app in one of the following ways:
+ * Select **Publish to Teams** under **DEPLOYMENT** in treeview of Teams Toolkit.
+ * Enter trigger **Teams: Publish to Teams** from command palette.
+
+ :::image type="content" source="../assets/images/teams-toolkit-v2/teams toolkit fundamentals/select-publish.png" alt-text="Select Publish":::
+
+2 Select **Install for your organization**.
+
+ :::image type="content" source="../assets/images/teams-toolkit-v2/teams toolkit fundamentals/installforyourorganization.png" alt-text="Install for your organization":::
+
+ Now the app is successfully published to the admin portal and you see the following notice:
+
+ :::image type="content" source="../assets/images/teams-toolkit-v2/teams toolkit fundamentals/confirm-publish.png" alt-text="Confirm Publish":::
+
+ Now the app is available on the **Manage apps** of Microsoft Teams admin center, where you, and the admin can review and approve it.
+
+ > [!NOTE]
+ > The app doesn't publish to your organization's app store yet. The step submits the app to the Microsoft Teams admin center where you can approve it for publishing to your organization's app store.
+
+### Approve on Admin Center
+
+Teams toolkit for Visual Studio Code built on top of the Teams App Submission API and it allows you to automate the submission-to-approval process for custom apps on Teams.
+
+ > [!NOTE]
+ > Ensure you have Teams app project in VS code. As an admin, **Manage apps** in the [Microsoft Teams admin center](https://admin.teams.microsoft.com/policies/manage-apps) is where you can view and manage all Teams apps for your organization. You can do the following activities in the admin center:
+ >
+ > * See the org level status and properties of apps.
+ > * Approve or upload new custom apps to your organization's app store.
+ > * Block or allow apps at the org level.
+ > * Add apps to Teams.
+ > * Purchase services for third-party apps.
+ > * View permissions requested by apps.
+ > * Grant admin consent to apps.
+ > * [Manage org wide app settings](https://admin.teams.microsoft.com/policies/manage-apps).
-![Install for your organization](./images/installforyourorganization.png)
+The following steps help you to approve from Admin Center:
-The app is available on the **Manage apps** of Microsoft Teams admin center, where you, and the admin, can review and approve it.
+1. Select **Go to admin portal**.
-As an admin, **Manage apps** in the [Microsoft Teams admin center](https://admin.teams.microsoft.com/policies/manage-apps) is where you can view and manage all Teams apps for your organization. You can see the org level status and properties of apps, approve or upload new custom apps to your organization's app store, block or allow apps at the org level, add apps to teams, purchase services for third-party apps, view permissions requested by apps, grant admin consent to apps, and [manage org wide app settings](https://admin.teams.microsoft.com/policies/manage-apps).
+1. Select the :::image type="icon" source="../assets/images/teams-toolkit-v2/teams toolkit fundamentals/Showall.PNG"::: icon > **Teams app** > **Manage apps**.
-Teams toolkit for Visual Studio Code built on top of the Teams App Submission API and it allows you to automates the submission-to-approval process for custom apps on Teams.
+ :::image type="content" source="../assets/images/teams-toolkit-v2/teams toolkit fundamentals/select-manage-apps.png" alt-text="Select Manage apps":::
-> [!NOTE]
-> The app doesn't publish to your organization's app store yet. The step submits the app to the Microsoft Teams admin center where you can approve it for publishing to your organization's app store.
+ You can view all Teams app for your organization.
-## Admin approval for Teams apps
+ In the Pending approval widget at the top of the page lets you know when a custom app is submitted for approval. In the table, a newly submitted app automatically publishes the status of submitted and blocked apps. You can sort the publishing status column in descending order to find the app.
-The admin of your Teams tenant can then go to the **Manage apps** in the Microsoft Teams admin center, in the left navigation, go to Teams apps > Manage apps. You can view into all Teams apps for your organization. In the Pending approval widget at the top of the page lets you know when a custom app is submitted for approval.
-In the table, a newly submitted app automatically publish the status of submitted and blocked apps. You can sort the publishing status column in descending order to find the app:
+ :::image type="content" source="../assets/images/teams-toolkit-v2/teams toolkit fundamentals/admin-approval-for-teams-app-1.png" alt-text="approval":::
- :::image type="content" source="../assets/images/teams-toolkit-v2/teams toolkit fundamentals/admin-approval-for-teams-app-1.png" alt-text="approval":::
+1. Select the app name to go to the app details page. On the **About** tab, you can view details about the app, including description, status, and app ID.
-Select the app name to go to the app details page. On the About tab, you can view details about the app, including description, status, and app ID:
+ :::image type="content" source="../assets/images/teams-toolkit-v2/teams toolkit fundamentals/about-submitted-app-1.png" alt-text="submitted app":::
- :::image type="content" source="../assets/images/teams-toolkit-v2/teams toolkit fundamentals/about-submitted-app-1.png" alt-text="submitted app":::
+1. Select the status dropdown and change from **Submitted** to **Publish**.
-Perform the following steps to publish the app :
+ After you publish the app, the publishing status changes to published and the status automatically changes to allowed.
-1. In the left navigation of the Microsoft Teams admin center, go to Teams apps > **Manage apps**.
-2. Select the app name to go to the app details page, and then in the status box, select **Publish**.
-After you publish the app, the publishing status changes to published and the status automatically changes to allowed.
+ For more information, see [Publish to your org](/MicrosoftTeams/manage-apps?toc=%2Fmicrosoftteams%2Fplatform%2Ftoc.json&bc=%2Fmicrosoftteams%2Fplatform%2Fbreadcrumb%2Ftoc.json)
-## Publish to Microsoft store
+## Publish to Microsoft Teams store
You can distribute your app directly to the store inside Microsoft Teams and reach millions of users around the world. If your app is also featured in the store, you can instantly reach potential customers. The apps published to the Teams store also automatically list on Microsoft AppSource, which is the official marketplace for Microsoft 365 apps and solutions.
-For more information, see ([Publish your app to the Microsoft Teams store](../concepts/deploy-and-publish/appsource/publish.md#publish-your-app-to-the-microsoft-teams-store)).
+For more information, see [Publish your app to the Microsoft Teams store](../concepts/deploy-and-publish/appsource/publish.md#publish-your-app-to-the-microsoft-teams-store).
## See also
-* [Manage multiple environments](TeamsFx-multi-env.md)
-* [Collaborate with other developers on Teams project](TeamsFx-collaboration.md)
+* [Distribute your Microsoft Teams app](../concepts/deploy-and-publish/apps-publish-overview.md)
+* [Create Teams app package](../concepts/build-and-test/apps-package.md)
+* [Prepare your Microsoft 365 tenant](../concepts/build-and-test/prepare-your-o365-tenant.md)
+* [Publish your app to the Microsoft Teams store](../concepts/deploy-and-publish/appsource/publish.md)
+* [Upload your app in Teams](../concepts/deploy-and-publish/apps-upload.md)
+* [Manage Teams app in the Microsoft Teams admin center](/MicrosoftTeams/manage-apps?toc=%2Fmicrosoftteams%2Fplatform%2Ftoc.json&bc=%2Fmicrosoftteams%2Fplatform%2Fbreadcrumb%2Ftoc.json)
platform Sideload And Test App https://github.com/MicrosoftDocs/msteams-docs/commits/main/msteams-platform/toolkit/sideload-and-test-app.md
+
+ Title: Sideload and test app in Teams environment
+
+description: In this module, learn how to sideload and test app in different environment
+
+ms.localizationpriority: high
+ Last updated : 03/03/2022++
+# Sideload and test app in Teams environment
+
+After adding API connection, you can test API connection in the Teams Toolkit local environment and deploy your application to the cloud. In CI/CD pipeline, after set-up with different platform, you need to create Azure service principal to provision and deploy resources.
+
+In this section, you'll learn
+
+* [Test API connection in local environment](#test-api-connection-in-local-environment)
+* [Deploy your application to Azure](#deploy-your-application-to-azure)
+* [Provision and deploy CI/CD resources](#provision-and-deploy-cicd-resources)
+
+## Test API connection in local environment
+
+The following steps help to test the API connection in the Teams Toolkit local environment:
+
+ 1. **Run npm install**
+
+ Run `npm install` under `bot` or `api` folder to install added packages.
+
+ 2. **Add API credentials to the local application settings**
+
+ Teams Toolkit does't ask for credentials but it leaves placeholders in the local application settings file. Replace the placeholders with the appropriate credentials to access the API. The local application settings file is the `.env.teamsfx.local` file in the `bot` or `api` folder.
+
+ 3. **Use the API client to make API requests**
+
+ Import the API client from the source code that needs access to the API:
+
+ ```BASH
+ import { yourApiClient } from '{relative path to the generated file}'
+ ```
+
+ 4. **Generate http(s) requests to target API (with Axios)**
+
+ The generated API client is an Axios API client. Use the Axios client to make requests to the API.
+
+ > [!Note]
+ > [Axios](https://www.npmjs.com/package/axios) is a popular nodejs package that helps you with http(s) requests. For more information on how to make http(s) requests, see [Axios example documentation](https://axios-http.com/docs/example) to learn how to make http(s).
+
+## Deploy your application to Azure
+
+To deploy your application to Azure, you need to add the authentication to the application settings for the appropriate environment. For example, your API might have different credentials for `dev` and `prod`. Based on environment needs, configure Teams Toolkit.
+
+Teams Toolkit configures your local environment. The bootstrapped sample code contains comments that tell you what app settings you need to configure. For more information on application settings, see [Add app settings](https://github.com/OfficeDev/TeamsFx/wiki/%5BDocument%5D-Add-app-settings)
+
+## Provision and deploy CI/CD resources
+
+To provision and deploy resources targeting Azure inside CI/CD, you must create an Azure service principal for use.
+
+Perform the following steps to create Azure service principals:
+
+1. Register an Microsoft Azure Active Directory (Azure AD) application in single tenant.
+2. Assign a role to your Azure AD application to access your Azure subscription. The `Contributor` role is recommended.
+3. Create a new Azure AD application secret.
+
+> [!TIP]
+> Save your tenant id, application id (AZURE_SERVICE_PRINCIPAL_NAME), and the secret (AZURE_SERVICE_PRINCIPAL_PASSWORD) for future use.
+
+For more information, see [Azure service principals guidelines](/azure/active-directory/develop/howto-create-service-principal-portal). The following are the three ways to create service principals:
+
+* [Microsoft Azure portal](/azure/active-directory/develop/howto-create-service-principal-portal)
+* [Windows PowerShell](/azure/active-directory/develop/howto-authenticate-service-principal-powershell)
+* [Microsoft Azure CLI](/cli/azure/create-an-azure-service-principal-azure-cli)
+
+## See also
+
+* [Publish Teams apps using Teams Toolkit](publish.md)
platform Teams Toolkit Fundamentals https://github.com/MicrosoftDocs/msteams-docs/commits/main/msteams-platform/toolkit/teams-toolkit-fundamentals.md
Last updated 05/24/2022
# Teams Toolkit Overview
-Teams Toolkit for Microsoft Visual Studio Code helps you to create and deploy Teams apps with integrated identity, access to cloud storage, data from Microsoft Graph, and other services in Azure and Microsoft 365 with zero-configuration approach. For Teams app development, similar to Teams Toolkit for Visual Studio, you can use [CLI tool](https://github.com/OfficeDev/TeamsFx/blob/dev/docs/cli/user-manual.md), which consists of Toolkit `teamsfx`.
-Teams Toolkit lets you create, debug, and deploy your Teams app right from Visual Studio Code. App development with the toolkit has the advantages of:
+Teams Toolkit lets you create, debug, and deploy your Teams app right from Visual Studio Code.App development with the toolkit has the following advantages:
* Integrated identity * Access to cloud storage * Data from Microsoft Graph * Azure and Microsoft 365 services with zero-configuration approach.
-Teams Toolkit brings all tools needed for building a Teams app in one place.
+For Teams app development, similar to Teams Toolkit for Visual Studio, you can use [CLI tool](https://github.com/OfficeDev/TeamsFx/blob/dev/docs/cli/user-manual.md), which consists of Toolkit `teamsfx`.
## User journey of Teams Toolkit Teams Toolkit automates manual work and provides great integration of Teams and Azure resources. The following image shows Teams Toolkit user journey: The main milestones of this journey are:
The main milestones of this journey are:
1. Use Azure account to provision and deploy your app to cloud. 1. Publish your app to Teams.
-## Install Teams Toolkit for Visual Studio Code
-
-1. Open **Visual Studio Code.**
-1. Select the Extensions view (**Ctrl+Shift+X** / **⌘⇧-X** or **View > Extensions**).
-
- :::image type="content" source="../assets/images/teams-toolkit-v2/teams toolkit fundamentals/install toolkit-1.png" alt-text="install":::
-
-1. Enter **Teams Toolkit** in the search box.
-
- :::image type="content" source="../assets/images/teams-toolkit-v2/teams toolkit fundamentals/install-toolkit2.png" alt-text="Toolkit":::
-
-1. Select **Install**.
-
- :::image type="content" source="../assets/images/teams-toolkit-v2/teams toolkit fundamentals/install-toolkit.png" alt-text="install toolkit 4.0.0":::
-
-> [!TIP]
-> You can install Teams Toolkit from [Visual Studio Code Marketplace](https://marketplace.visualstudio.com/items?itemName=TeamsDevApp.ms-teams-vscode-extension).
-
-## Take a tour of Teams Toolkit
-
-After Toolkit installation, you'll see the Teams Toolkit UI as shown in following image:
--
-You can select **Get Started** to explore the Teams Toolkit, or select **Create a new Teams App** to create one Teams project. If you have a Teams project created by Teams Toolkit opened in Visual Studio Code, you will see Teams Toolkit UI with all functionalities as shown in the following image:
--
-Let's take a tour of the topics covered in this document.
-
-## Accounts
-
-To develop a Teams app, you need at least one Microsoft 365 account with a valid subscription. If you want to host your backend resources on Azure, an Azure account is also needed. Teams Toolkit supports integrated experience to sign-in, provision, and deployment for Azure resources. You can [create a free Azure account](https://azure.microsoft.com/free/) before you start.
-
-## Environment
-
-Teams Toolkit helps you to create and manage multiple environments, provision, and deploy artifacts to the target environment for Teams App.
-
-### TeamsFx Collaboration
-
-It allows developers and project owner to invite other collaborators to the TeamsFx project to debug, provision, and deploy the same TeamsFx project.
+The following table helps you to get the overview of Teams Toolkit in Visual Studio Code:
+| Process | Description |
+| - | - |
+| Install Teams Toolkit | You can install Teams Toolkit in two ways: <br> - Using Visual Studio Code <br> - Using Visual Studio Code Marketplace|
+| Support for build environments | You have two different types of environment: <br> - Javascript or Typescript <br> - SPFx |
+| Support for app types and Azure function | There are two different types of apps: <br> - Capability-based app such as tab, bot, message extension <br> - Scenario-based Teams app such as notification bot, command bot and SSO enabled personal tab |
+| Develop your Teams app | It contains: <br> - Add and manage environment <br> - Create multi-capability app <br> - Create capability based cloud resources <br> - Integrate third party API <br> - Customize manifest file <br> - TeamsFx SDK |
+| Debug your Teams app | It contains: <br> - Debug your Teams app locally <br> - Debug background process|
+| Host your Teams app | It contains: <br> - Provision resources to the cloud <br> - Deploy to the cloud|
+| Test your Teams app | It contains: <br> - Integrate and collabrate <br> - Zip Teams metadata package <br> - Sideload and test app in Teams environment <br> - Test app behavior in different environment|
+| Publish your Teams app | It contains: <br> - Publish your app <br> - Manage admin approval <br> - Publish to store <br> - Integrate with Developer Portal |
-## Development
+### Entities integrated with Teams Toolkit
-Teams Toolkit helps you to create and customize your Teams app project that makes the Teams app development work simpler.
+Teams Toolkit is an extension in Visual Studio Code. It is integrated with the following entities within Teams Toolkit.such as Azure AD and Microsoft 365, Developer Portal and Microsoft graph. All the entities are integrated within Teams Toolkit and help users to create an app.
-### Create a new Teams app
+| Entities | Description |
+| - | - |
+| Azure AD | Azure Active Directory (Azure AD) is a cloud-based identity and access management service. This service helps your employees access external resources, such as Microsoft 365, the Azure portal, and thousands of other SaaS applications. |
+| Microsoft 365 | Teams developer account while developing an app.|
+| Developer Portal | The Developer Portal for Teams is the primary tool for configuring, distributing, and managing your Microsoft Teams apps. With the Developer Portal, you can collaborate with colleagues on your app, set up runtime environments, and much more. |
+| Microsoft Graph | Microsoft Graph is the gateway to data and intelligence in Microsoft 365. It provides a unified programmability model that you can use to access the tremendous amount of data in Microsoft 365, Windows, and Enterprise Mobility + Security. |
-It helps you to start with Teams app development by creating new Teams project using Teams Toolkit either by using **Create new project** or **Start from a sample**.
-
-### Add Features
-
-It helps you to incrementally add additional Teams capabilities such as **Tab** or **Bot** or optionally add Azure resources such as **Azure SQL Database** or **Azure Key Vault**, which fits your development needs to your current Teams app. You can also add **Single Sign-on** or **CI/CD workflows** for your Teams app.
-
-### Edit manifest file
-
-It helps you to edit the Teams app integration with Teams client.
-
-## Deployment
-
-During or after the development, ensure to provision, deploy, and publish Teams app before it is accessible to users.
-
-### Provision in the cloud
-
-It integrates with Azure Resource Manager that enables you to provision Azure resources, which your application needs for code approach.
-
-### Deploy to the cloud
-
- It helps you to deploy the source code to Azure.
-
-### Publish to Teams
-
-After creating the app, you can distribute your app to different scope, such as individual, team, organization, or anyone. Publish to Teams helps you to publish your developed app.
-
-#### TeamsFx CLI
-
-It is a text-based command line interface that accelerates Teams application development and also enables CI/CD scenario where you can integrate CLI in scripts for automation.
-
-#### TeamsFx SDK
-
-It helps you to reduce tasks of implementing identity and access to cloud resources to single-line statements with zero configuration.
-
-## Help and Feedback
+Teams Toolkit brings all tools needed for building a Teams app in one place.
-In this section, you can find the documentation and resources you need. You can select **Report issues on GitHub** in the Teams Toolkit to get **Quick support** from product expert. Browse the issue before you create a new one, or visit [StackOverflow tag `teams-toolkit`](https://stackoverflow.com/questions/tagged/teams-toolkit) to submit feedback.
-<!--
-Let's explore Teams Toolkit features.
+## Manage your apps using Developer Portal
-| Teams Toolkit Features | Includes | What you can do |
-| | | |
-| **Accounts** | &nbsp; | &nbsp; |
-| &nbsp; | Microsoft 365 account | Use your Microsoft 365 account with a valid E5 subscription for building your app. |
-| &nbsp; | Azure account | Use your Azure account for deploying app on Azure. |
-| **Environment** | &nbsp; | &nbsp; |
-| &nbsp; | local | Deploy your app in the default local environment with local machine environment configurations. |
-| &nbsp; | dev | Deploy your app in the default dev environment with remote or cloud environment configurations. You can create more environments, as you need. |
-| **Development** | &nbsp; | &nbsp; |
-| &nbsp; | Create a new Teams app | Use the toolkit wizard to prepare project scaffolding for app development. |
-| &nbsp; | View samples | Select any of Teams Toolkit's 12 sample apps. The toolkit downloads the app code from GitHub, and you can build the sample app. |
-| &nbsp; | Add Features | - Add other required Teams capabilities to Teams app during development process. </br> - Add optional cloud resources suitable for your app. |
-| &nbsp; | Edit manifest file | Edit the Teams app integration with Teams client. |
-| **Deployment** | &nbsp; | &nbsp; |
-| &nbsp; | Provision in the cloud | Allocate Azure resources for your application. Teams Toolkit is integrated with Azure Resource Manager. |
-| &nbsp; | Zip Teams metadata package | Create the app package that can be uploaded to Teams or Developer Portal. It contains the app manifest and app icons. |
-| &nbsp; | Deploy to the cloud | Deploy the source code to Azure. |
-| &nbsp; | Publish to Teams | Publish your developed app and distribute it to scopes, such as personal, team, channel, or organization. |
-| &nbsp; | Developer Portal for Teams | Use Developer Portal to configure and manage your Teams app. |
-| **Help and Feedback** | &nbsp; | &nbsp; |
-| &nbsp; | Quick start | View the Teams Toolkit Quick start help within Visual Studio Code. |
-| &nbsp; | Tutorial | Select to access different tutorials. |
-| &nbsp; | Documentation | Select to access the Microsoft Teams Developer Documentation. |
-| &nbsp; | Report issues on GitHub | Select to access GitHub page and raise any issues. |
+As Teams Toolkit is integrated with Developer Portal, you can configure, distribute, and manage your app using [Developer Portal for Teams](../concepts/build-and-test/teams-developer-portal.md) under DEPLOYMENT after creating an app. For more information, see [manage your Teams apps using Developer Portal](../concepts/build-and-test/manage-your-apps-in-developer-portal.md).
>
-> [!TIP]
-> Browse existing issues before you create a new one, or visit [StackOverflow tag `teams-toolkit`](https://stackoverflow.com/questions/tagged/teams-toolkit) to submit feedback.
## See also
-* [Create new project using Teams Toolkit](create-new-project.md)
-* [Prepare accounts to build Teams apps](accounts.md)
-* [Publish Teams apps using Teams Toolkit](publish.md)
-* [Use Teams Toolkit to provision cloud resources](provision.md)
-* [Deploy to the cloud](deploy.md)
+* [Create a new Teams project](create-new-project.md)
+* [Install Teams Toolkit](install-Teams-Toolkit.md)
+* [Explore Teams Toolkit](explore-Teams-Toolkit.md)
+* [Prepare to build apps using Microsoft Teams Toolkit](build-environments.md)
platform Test App Behavior https://github.com/MicrosoftDocs/msteams-docs/commits/main/msteams-platform/toolkit/test-app-behavior.md
+
+ Title: Test app behavior in different environment
+
+description: In this module, learn how to test app behavior in different environment
+
+ms.localizationpriority: high
+ Last updated : 03/03/2022++
+# Test app behavior in different environment
+
+You can test your Teams app after integrating with Microsoft Teams. To test your Teams app, you need to create at least one workspace in your environment. You can use Teams Toolkit for testing your Teams app:
+
+* **Locally hosted in Teams**: Teams Toolkit locally hosts your Teams app by sideloading it into Teams for testing in local environment.
+
+* **Cloud-hosted in Teams**: For testing your Teams app remotely, you need to Cloud-host it using provisioning and deploying on Microsoft Azure Active Directory(Azure AD). It involves uploading your solution to the Azure AD and then upload into Teams.
+
+> [!NOTE]
+> For production-scale debugging and testing, we recommend that you follow your own company guidelines to ensure you are able to support testing, staging, and deployment through your own processes.
+
+## Locally hosted environment
+
+Teams is a cloud-based product that requires all services it accesses, to be available publicly using HTTPS endpoints. Local hosting is about sideloading into Teams for testing in local environment.
+
+> [!NOTE]
+> Although you can use any tool of your choice for testing, we recommend you to use [ngrok](https://ngrok.com/download)
+
+## Cloud-hosted environment
+
+To host your development and production code and their HTTPS endpoints, You need to remotely test your teams app using provisioning and deploying on Azure AD. You need to ensure that all domains are accessible from your Teams app listed in the [`validDomains`](~/resources/schem#validdomains) object in the `manifest.jason` file
+
+> [!NOTE]
+> To ensure a secure environment, be explicit about the exact domain and subdomains you reference and those domains must be in your control. For example, `*.azurewebsites.net` is not recommended, however `contoso.azurewebsites.net` is recommended.
+
+## See also
+
+* [Debug your Microsoft Teams app locally](debug-local.md)
+* [Debug background process](debug-background-process.md)
+* [Use Teams Toolkit to provision cloud resources](provision.md)
+* [Deploy to the cloud](deploy.md)
+* [Preview and customize Teams app manifest](TeamsFx-preview-and-customize-app-manifest.md)
+* [Manage multiple environments](TeamsFx-multi-env.md)
platform Tools Prerequisites https://github.com/MicrosoftDocs/msteams-docs/commits/main/msteams-platform/toolkit/tools-prerequisites.md
+
+ Title: Prerequisites for creating your Teams app using Visual Studio Code
+
+description: In this module, learn the prerequisites required for Tools and SDK
+
+ms.localizationpriority: high
+ Last updated : 03/14/2022+
+# Prerequisites for creating your Teams app
+
+Ensure that the following prerequisites are met before you start creating your Teams app:
+
+* [Basic requirements to build your Teams app](#basic-requirements-to-build-your-teams-app)
+* [Prepare Accounts to build your Teams app](#accounts-to-build-your-teams-app)
+* [Sideloading permission](#sideloading-permission)
+
+## Basic requirements to build your Teams app
+
+Ensure the following requirements are met before you start build your Teams app:
+
+| &nbsp; | Basic requirements | For using| For environment type|
+ | | | |
+ | **Required** | &nbsp; | &nbsp; | &nbsp; |
+ | &nbsp; | Teams Toolkit| A Microsoft Visual Studio Code extension that creates a project scaffolding for your app. Use the latest version. | JavaScript and SPFx|
+ | &nbsp; | [Microsoft Teams](https://www.microsoft.com/microsoft-teams/download-app) | Collaborate with everyone you work with through apps for chat, meetings, call - all in one place.| JavaScript and SPFx|
+ | &nbsp; | [Node.js](https://nodejs.org/en/download/) | Back-end JavaScript runtime environment. Use the latest v16 LTS release.| JavaScript and SPFx|
+ | &nbsp; |[Node Package Manager (NPM)](https://www.npmjs.com/package/@microsoft/teamsfx) | Install and manage packages for use in both Node.js and ASP.NET Core applications.| JavaScript and SPFx|
+ | &nbsp; | [Microsoft&nbsp;Edge](https://www.microsoft.com/edge) (recommended) or [Google Chrome](https://www.google.com/chrome/) | A browser with developer tools. | JavaScript and SPFx|
+ | &nbsp; | [Visual Studio Code](https://code.visualstudio.com/download) | JavaScript, TypeScript, or SharePoint Framework (SPFx) build environments. Use version 1.55 or later. | JavaScript and SPFx|
+ | **Optional** | &nbsp; | &nbsp; | &nbsp; |
+ | &nbsp; | [Azure Tools for Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=ms-vscode.vscode-node-azure-pack) and [Azure CLI](/cli/azure/install-azure-cli) | Access stored data or deploy a cloud-based backend for your Teams app in Azure. | JavaScript|
+ | &nbsp; | [React Developer Tools for Chrome](https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi) OR [React Developer Tools for Microsoft&nbsp;Edge](https://microsoftedge.microsoft.com/addons/detail/react-developer-tools/gpphkfbcpidddadnkolkpfckpihlkkil) | A browser DevTools extension for the open-source React JavaScript library. | JavaScript|
+ | &nbsp; | [Microsoft Graph Explorer](https://developer.microsoft.com/graph/graph-explorer) | A browser-based tool that lets you run a query from Microsoft Graph data. | JavaScript and SPFx|
+ | &nbsp; | [Developer Portal for Teams](https://dev.teams.microsoft.com/) | Web-based portal to configure, manage, and distribute your Teams app including to your organization or the Teams store.| JavaScript and SPFx|
+
+ > [!NOTE]
+ >
+ > * The document is tested with Teams Toolkit version 4.0.0 and Nodejs version 16.
+ > * Bookmark the Microsoft Graph Explorer, to learn about Microsoft Graph services. This browser-based tool allows you to query and access Microsoft Graph outside of an app.
+
+## Accounts to build your Teams app
+
+Ensure you have the following accounts before you start build your Teams app:
+
+| Accounts | For using| For environment type|
+| | |
+|[Microsoft 365 account with valid subscription](#microsoft-365-developer-program)|Teams developer account while developing an app.| JavaScript and SPFx|
+|[Azure account](accounts.md#azure-account-to-host-backend-resources)|Backend resources on Azure.| JavaScript and SPFx|
+|[SharePoint collection site administrator account](#sharepoint-collection-site-administrator-account) |Deployment for hosting.| SPFx|
+
+### Microsoft 365 developer program
+
+To create a Microsoft 365 account, sign-up for a Microsoft 365 developer program subscription. The subscription is free for 90 days and continues to renew as long as you're using it for development activity.
+
+If you have a Visual Studio Enterprise or Professional subscription, both programs include free Microsoft 365 [developer subscription](https://aka.ms/MyVisualStudioBenefits). It's active as long as your Visual Studio subscription is active. For more information, see [Microsoft 365 developer subscription](https://developer.microsoft.com/microsoft-365/dev-program).
+
+You can sign-up for the developer program by using one of the following account types:
+
+* **Microsoft account for personal use**
+
+ :::row:::
+
+ :::column span="3":::
+
+ The account provides access to Microsoft products and cloud services, such as Outlook, Messenger, OneDrive, MSN, Xbox Live, or Microsoft 365.
+
+ You can sign-up for an Outlook.com mailbox to create a Microsoft account, which can be used to access consumer-related Microsoft cloud services or Azure.
+
+ :::column-end:::
+ :::column span="1":::
+ :::image type="content" source="../assets/images/teams-toolkit-v2/teams toolkit fundamentals/personal-account-icon.png" alt-text="personal account.":::
+ :::column-end:::
+
+ :::row-end:::
+
+* **Microsoft work account for business**
+
+ :::row:::
+
+ :::column span="3":::
+
+ The account provides access to all small, medium, and enterprise business-level Microsoft cloud services. The services include Azure, Microsoft Intune, or Microsoft 365.
+
+ When you sign-up to one of these services as an organization, a cloud-based directory is automatically provisioned in Azure AD to represent your organization.
+
+ :::column-end:::
+ :::column span="1":::
+ :::image type="content" source="../assets/images/teams-toolkit-v2/teams toolkit fundamentals/work-account-icon.png" alt-text="work account.":::
+ :::column-end:::
+
+ :::row-end:::
+
+#### Create a free Microsoft 365 developer account
+
+To create a free Microsoft 365 developer account, join the Microsoft 365 developer program and perform the following account:
+
+1. Go to the [Microsoft 365 developer program](https://developer.microsoft.com/microsoft-365/dev-program).
+1. Select **Join Now**.
+1. Set up your administrator account.
+
+ You can see the following image after the completion of the subscription:
+
+ :::image type="content" source="../assets/images/teams-toolkit-v2/m365-account.png" alt-text="M365 Account":::
+
+### Azure account
+
+You need an Azure account to host a Teams app or the backend resources for your Teams app using Teams Toolkit in Visual Studio Code. You must need Azure subscription in the following scenarios:
+
+* If you already have an existing app on a different cloud provider other than Azure, and you want to integrate the app on Teams platform, you must have an Azure subscription.
+* You can select an Azure subscription to host your backend resources using another cloud provider, or on your own servers if they're available from the public domain.
+
+> [!NOTE]
+> You need to [Create a free account](https://azure.microsoft.com/free/) before you begin.
+
+### SharePoint collection site administrator account
+
+While creating Teams app using SPFx environment, you'll need SharePoint collection site administrator account at deployment for hosting. If you're using a Microsoft 365 developer program tenant, you can use the administrator account you created at the time.
+
+## Sideloading permission
+
+After creating the app, you must load your app in Teams without distributing it. This process is known as sideloading. Sign-in to your Microsoft 365 account to view this option.
+
+You can verify if the sideloading permission is enabled using either Visual Studio Code or Teams client.
+
+<br>
+<details>
+<summary><b>Verify sideloading permission using Visual Studio Code</b></summary>
+
+1. Open **Visual Studio Code**.
+1. Select the Teams Toolkit :::image type="icon" source="../assets/images/teams-toolkit-v2/teams-toolkit-sidebar-icon.PNG"::: icon from the Teams Toolkit toolbar.
+
+ > [!NOTE]
+ > If you're unable to see the option, see [Install Teams Toolkit](install-Teams-Toolkit.md) to install Teams Toolkit extension in Visual Studio Code.
+1. Select **Sign in to M365** under **ACCOUNTS** and sign-in to your Microsoft 365 account.
+
+ :::image type="content" source="../assets/images/teams-toolkit-v2/accounts.png" alt-text="accounts details":::
+
+1. Check whether you can view the option **Sideloading enabled** as shown in the following image:
+
+ :::image type="content" source="../assets/images/teams-toolkit-v2/sideloading.png" alt-text="Enable sideloading":::
+
+</details>
+<br>
+<details>
+<summary><b>Verify sideloading permission using Teams client</b></summary>
+
+1. In the Teams client, select **Apps**.
+1. Select **Manage your app**.
+1. Select **Upload an app**.
+
+ :::image type="content" source="../assets/images/teams-toolkit-v2/upload-app.png" alt-text="Publish an app":::
+
+4. Check whether you can see the option **Upload a custom app** as shown in the following image:
+
+ :::image type="content" source="../assets/images/teams-toolkit-v2/upload-custom-app1.png" alt-text="Upload a custom app":::
+
+</details>
+
+### Enable sideloading using admin center
+
+If you're unable to view the option **Upload a custom app,** then it indicates that you don't have the required permission for sideloading.
+
+* For a tenant admin, enable the sideloading setting for your tenant or organization in the Teams admin center.
+* If you aren't a tenant admin, you'll need to contact your tenant admin to enable sideloading.
+
+If you have admin rights, perform the following steps to upload the custom app using admin center:
+
+ 1. Sign-in to [Microsoft 365 admin center](https://admin.microsoft.com/Adminportal/Home?source=applauncher#/homepage#/) with your admin credentials.
+
+ 1. Select the :::image type="icon" source="../assets/images/teams-toolkit-v2/showall icon.PNG"::: icon > **Teams**.
+
+ :::image type="content" source="../assets/images/teams-toolkit-v2/m365-admin-center.png" alt-text="Microsoft 365 Admin center":::
+
+ > [!Note]
+ > It can take **up to 24 hours** for the **Teams** option to appear. You can [upload your custom app to a Teams environment](/microsoftteams/upload-custom-apps) for testing and validation.
+
+ 1. Sign-in to Microsoft Teams admin center with your admin credentials.
+ 1. Select the :::image type="icon" source="../assets/images/teams-toolkit-v2/showall icon.PNG"::: icon > **Teams apps** > **Setup policies**.
+
+ :::image type="content" source="../assets/images/teams-toolkit-v2/m365-admin-center1.png" alt-text="Microsoft 365 Admin center1":::
+
+ 1. Select **Global (Org-wide default)**
+
+ :::image type="content" source="../assets/images/teams-toolkit-v2/select-manage-policies.png" alt-text="Select Manage Policies":::
+
+ 1. Set toggle **Upload custom apps** to **On** position.
+
+ :::image type="content" source="../assets/images/teams-toolkit-v2/Upload-custom-apps.png" alt-text="Upload Custom Apps":::
+
+ 5. Select **Save**.
+
+ > [!Note]
+ > It can take up to 24 hours for sideloading to become active. In the meantime, you can use **upload for your tenant** to test your app. To upload the .zip package file of the app, see [Upload custom apps](/microsoftteams/teams-app-setup-policies).
+
+ Ensure that, now you have the sideloading permission using the steps mentioned in [verify sideloading permission using Visual Studio Code or Teams client.](#sideloading-permission)
+
+</details>
+
+## See also
+
+* [Manage custom app policies and settings in Teams](/microsoftteams/teams-custom-app-policies-and-settings)
+* [Manage app setup policies in Teams](/microsoftteams/teams-app-setup-policies)
+* [Upload custom apps](/microsoftteams/teams-app-setup-policies)
+* [Provision cloud resources using Teams Toolkit](provision.md)
+* [Deploy Teams app to the cloud](deploy.md)
platform Add Incoming Webhook https://github.com/MicrosoftDocs/msteams-docs/commits/main/msteams-platform/webhooks-and-connectors/how-to/add-incoming-webhook.md
To add an Incoming Webhook to a Teams channel, follow these steps:
1. Open the channel in which you want to add the webhook and select &#8226;&#8226;&#8226; **More options** from the top navigation bar. 1. Select **Connectors** from the dropdown menu:
- ![Select Connector](~/assets/images/connectors.png)
+ :::image type="content" source="../../assets/images/connectors.png" alt-text="This screenshot show how to select connector.":::
1. Search for **Incoming Webhook** and select **Add**. 1. Select **Configure**, provide a name, and upload an image for your webhook if necessary:
- ![Configure button](~/assets/images/configure.png)
+ :::image type="content" source="../../assets/images/configure.png" alt-text="This screenshot shows how to configure and upload an image for your webhooks.":::
1. Copy and save the unique webhook URL present in the dialog window. The URL maps to the channel and you can use it to send information to Teams. Select **Done**.
- ![Unique URL](~/assets/images/url.png)
+ :::image type="content" source="../../assets/images/url.png" alt-text="This screenshot shows the unique webhook URL.":::
The webhook is available in the Teams channel.
To remove an Incoming Webhook from a Teams channel, follow these steps:
1. Select **Configured** under **Manage**. 1. Select the **<*1*> Configured** to see a list of your current connectors:
- ![Configured webhook](~/assets/images/configured.png)
+ :::image type="content" source="../../assets/images/configured.png" alt-text="This screenshot shows how to configured to see list of your current connectors.":::
1. Select **Manage** for the connector that you want to remove:
- ![Manage webhook](~/assets/images/manage.png)
+ :::image type="content" source="../../assets/images/manage.png" alt-text="This screenshot shows how to manage for connector that you want to remove.":::
1. Select **Remove** to view the **Remove Configuration** dialog box.
- ![Remove Configuration](~/assets/images/removeconfiguration.png)
+ :::image type="content" source="../../assets/images/removeconfiguration.png" alt-text="This screenshot shows how to view the remove configuration dialog box.":::
1. Complete the dialog box fields and checkboxes and select **Remove**.
- ![Final Remove](~/assets/images/finalremove.png)
+ :::image type="content" source="../../assets/images/finalremove.png" alt-text="This screenshot shows how to remove an Incoming Webhooks from Teams channel.":::
## Code sample