Customize app manifest
App manifest (previously called Teams app manifest) describes how your app integrates into Teams. After scaffolding, the default app manifest file is available at appPackage/manifest.json
. The app manifest file contains some environment variables with format of ${{XX_XX}}
, and the actual values are resolved using Teams Toolkit with env files like env/.env.dev
and env/.env.local
.
To preview app manifest with actual content, Teams Toolkit generates the preview app manifest files under appPackage/build
folder:
└───appPackage
└───build
├───appPackage.{env}.zip - Zipped app package of remote Teams app
├───appPackage.local.zip - Zipped app package of local Teams app
├───manifest.{env}.json - Previewed manifest of remote Teams app
└───manifest.local.json - Previewed manifest of local Teams app
You can preview the app manifest file in local and remove environments.
Preview the app manifest file in local environment
To preview the app manifest file in local environment, you can press F5 to run local debug. After you generate the environment variables in env/.env.local
, the app package and the preview app manifest is built under appPackage/build
folder.
You can also trigger Zip Teams App Package
from tree view or Teams: Zip Teams app Package
from command palette to generate the previewed app manifest and app package.
Preview the app manifest file in remote environment
To preview the app manifest file in remote environment, you can trigger Provision
from tree view or Teams: Provision in the cloud
from command palette. It generates environment variables for remote Teams app, build app package and the preview app manifest under appPackage/build
folder.
You can also trigger Zip Teams App Package from tree view or Teams: Zip Teams app Package
from command palette to generate the preview app manifest and app package.
Customize the app manifest for Visual Studio Code
During local debug or provision, Teams Toolkit loads app manifest from appPackage/manifest.json
and resolves app manifest by environment variables defined in env/.env.xx
, then creates or updates Teams app in Teams Developer Portal.
You can define your own manifest.json file in
teamsapp.yml
andteamsapp.local.yml
. For example, you can put your manifest.json file intest/test.json
, and update themanifestPath
parameters in yaml files.- uses: teamsApp/zipAppPackage # Build Teams app package with latest env value with: manifestPath: ./test/test.json # Path to manifest template outputZipPath: ./appPackage/build/appPackage.${{TEAMSFX_ENV}}.zip outputJsonPath: ./appPackage/build/manifest.${{TEAMSFX_ENV}}.json
You can define your own environment variables. The default manifest.json contains some placeholders with format of ${{xx_xx}}. You can define your own environment variables and add placeholders in the manifest.json file. For example, you can customize app description by defining a new environment variable in env/.env.xx file, and update manifest.json with corresponding placeholder.
.env.dev
TEAMS_APP_DESCRIPTION=This is an amazing app
manifest.json
{ "$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.16/MicrosoftTeams.schema.json", "manifestVersion": "1.16", "description": { "short": "${{TEAMS_APP_DESCRIPTION}}", "full": "Full description of tab0418" }, }
Validate Application
After customization, you may want to validate your app manifest or app package. You can trigger Validate Application
from tree view, or Teams: ValidateApplication
from command palette. There are two options, Validate using manifest schema
or Validate app package using validation rules
.
Validate using the app manifest schema
This option renders appPackage/manifest.json
with environment variables, and then validates your app manifest with its schema.
CLI command:
teamsfx validate --manifest-path YOUR-PATH-TO-MANIFEST
If you meet MissingEnvironmentVariablesError
, it means that Teams Toolkit can't find corresponding environment variables defined in manifest.json. You may need to run Provision or F5 to generate environment variables, or manually update .env.xx
file to fulfill the value.
Validate app package using validation rules
This option validates the zipped app package with validation rules.
CLI command:
teamsfx validate --app-package-file-path YOUR-PATH-TO-APP-PACKAGE
It has additional validation rules than the app manifest schema. For example, if static tab section has entityId "conversations" and name, the following error appears:
Update Teams app
After you've previewed and validated the app manifest file, you can sync your local changes to Teams Developer Portal by triggering Teams: Update Teams app
command from command palette:
CLI command:
teamsfx update teams-app
Note
The change is reflected in Developer Portal. Any manual updates in Developer Portal are overwritten.
If the app manifest file is outdated due to configuration file change or template change, select any one of the following actions:
- Preview only: Local app manifest file is overwritten according to current configuration.
- Preview and update: Local app manifest file is overwritten according to current configuration and also updated to Teams platform.
- Cancel: No action is taken.
To preview values for local and dev environment
In appPackage/manifest.json
, you can go to CodeLens to preview the values for local
and dev
environment.
Note
Provision the environment or execute local debug to generate environment variables.
You can go to .env
file by selecting the CodeLens, which provide a dropdown list with all the environment names. After selecting one environment, the corresponding .env
file opens.
To preview values for all the environment, you can hover over the placeholder. It shows a list of environment names and corresponding values. If you haven't provisioned the environment or executed the local debug, the environment variable may not exist. Select Trigger Teams: Provision in the cloud command to see placeholder value
or Trigger local debug to see placeholder value
.
See also
Important
We've introduced the Teams Toolkit v5 extension within Visual Studio Code. This version comes to you with many new app development features. We recommend that you use Teams Toolkit v5 for building your Teams app.
Teams Toolkit v4 extension will soon be deprecated.
Customize app manifest for Visual Studio Code
App manifest (previously called Teams app manifest) describes how your app integrates into Teams. The app 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 app manifest with actual content, Teams Toolkit generates the preview app manifest files under build/appPackage
folder:
└───build
└───appPackage
├───appPackage.{env}.zip - Zipped app package of remote Teams app
├───appPackage.local.zip - Zipped app package of local Teams app
├───manifest.{env}.json - Previewed manifest of remote Teams app
└───manifest.local.json - Previewed manifest of local Teams app
You can preview the app manifest file in local and remote environments.
Preview the app manifest file in local environment
To preview the app manifest file in local environment, you can press F5 to run local debug. After generating default local settings, the app package and the preview app manifest builds under build/appPackage
folder.
You can preview local app manifest file by two methods:
- Use preview option in CodeLens.
- Use Zip Teams metadata package option.
The following steps help to preview local app manifest file by using preview option in CodeLens:
To preview the local app manifest file by using Zip Teams metadata package option:
Select
manifest.template.json
file.Select the Teams Toolkit
icon in the Visual Studio Code Activity Bar.
Select Zip Teams metadata package under DEPLOYMENT.
Select local.
Following is a preview local image:
Preview the app manifest file in remote environment
To preview the app manifest file using Visual Studio Code:
Select Provision in the cloud under DEPLOYMENT in Teams Toolkit.
To preview the app manifest file using command palette. You can trigger Teams: Provision in the cloud from command palette.
It generates configuration for remote Teams app, builds package, and preview the app manifest under build/appPackage
folder.
You can preview the app manifest file in remote environment by two methods:
- Use preview option in CodeLens.
- Use Zip Teams metadata package option.
To preview the app manifest file by using preview option in CodeLens:
Select Preview in the CodeLens of
manifest.template.json
file.Select your environment.
Note
If there are more than one environment, you need to select the environment you want to preview.
To preview the app manifest file by selecting Zip Teams metadata package in remote environment:
Select
manifest.template.json
file.Select the Teams Toolkit
icon in the Visual Studio Code Activity Bar.
Select Zip Teams metadata package under DEPLOYMENT.
Select your environment.
Note
If there are more than one environment, you need to select the environment you want to preview.
Sync local changes to Developer Portal
After previewing the app manifest file, you can sync your local changes to Developer Portal by the following ways:
Deploy app manifest.
You can deploy the app manifest in any of the following ways:
Right-click the
manifest.template.json
file, and select Deploy Teams app manifest from context menu.Trigger Teams: Deploy Teams app manifest by selecting it from the command palette.
Update to Teams platform.
You can update to Teams platform in any of the following ways:
You can also trigger Teams: Update manifest to Teams platform from the command palette:
Note
- The Trigger from editor CodeLens or menu bar updates the current app manifest file to Teams platform.
- The Trigger from command palette requires selecting target environment.
CLI command:
teamsfx deploy manifest --include-app-manifest yes
Note
The change is reflected in Developer Portal. Any manual updates in Developer Portal are overwritten.
If the app manifest file is outdated due to configuration file change or template change, select any one of the following actions:
- Preview only: Local app manifest file is overwritten according to current configuration.
- Preview and update: Local app manifest file is overwritten according to current configuration and also updated to Teams platform.
- Cancel: No action is taken.
Customize your app manifest
Teams Toolkit consists of the following app manifest template files under manifest.template.json
folder across local and remote environments:
manifest.template.json
templates/appPackage
During the local debug or provision, Teams Toolkit loads the app manifest file from manifest.template.json
with the configurations from state.{env}.json
, config.{env}.json
, and creates Teams app in Developer Portal.
Supported placeholders in manifest.template.json
The following list provides supported placeholders in manifest.template.json
:
{{state.xx}}
is pre-defined placeholder, and it's value is resolved by Teams Toolkit defined instate.{env}.json
. Ensure not to modify the values instate.{env}.json
.{{config.manifest.xx}}
is a customized placeholder and it's value is resolved fromconfig.{env}.json
.
To add customized parameter
Add customized parameter as follows: a. Add a placeholder in
manifest.template.json
with pattern{{config.manifest.xx}}
. b. Add a config value inconfig.{env}.json
.{ "manifest": { "KEY": "VALUE" } }
You can go to configuration file by selecting any one of the config placeholders Go to config file or View the state file in
manifest.template.json
.
Validate app manifest
During operations such as Zip Teams metadata package, Teams Toolkit validates app manifest against its schema. The following list provides different ways to validate app manifest:
In Visual Studio Code, trigger Teams: Validate manifest file from command palette:
In CLI, use command:
teamsfx validate --env local teamsfx validate --env dev ```
To preview values for local and dev environment
In manifest.template.json
, you can go to CodeLens to preview the values for local
and dev
environment.
Note
Provision the environment or execute local debug to generate values for placeholders.
You can go to state file or configuration file by selecting the CodeLens, which provides a drop down list with all the environment names. After selecting one environment, the corresponding state file or configuration file opens.
To preview values for all the environments, you can hover over the placeholder. It shows a list with environment names and corresponding values. If you haven't provisioned the environment or executed the local debug, select Trigger Teams: Provision in the cloud command to see placeholder value
or Trigger local debug to see placeholder value
.
See also
Feedback
Submit and view feedback for