Deployment guide - OfficeDev/microsoft-teams-apps-survey GitHub Wiki
To begin, you will need:
- A Microsoft 365 subscription
- A team with the users who will be sending Surveys using this app. (You can add and remove team members later!)
- A copy of the Survey app GitHub repo (https://github.com/OfficeDev/Microsoft-Teams-Survey-app)
There are two ways to deploy Survey App. You can choose one of the following ways -
- NPM based deployment
- PowerShell based deployment
- Install Node.js (using https://nodejs.org/en/download/) locally on your machine.
To create the Teams Survey app package:
- Make sure you have cloned or downloaded and unzipped, the app repository locally.
- Open the actionManifest.json file in a text editor.
- Change the placeholder fields in the manifest to values appropriate for your organization.
- packageID - A unique identifier for this app in reverse domain notation. E.g: com.contoso.surveyapp. (Max length: 64)
- developer.name (What's this?)
- developer.websiteUrl
- developer.privacyUrl
- developer.termsOfUseUrl
Note: Make sure you do not change to file structure of the app package, with no new nested folders.
-
Install Node.js (using https://nodejs.org/en/download/) locally on your machine.
-
Open Command Line on your machine.
-
Navigate to the app package folder with the name
microsoft-teams-survey-app
. -
Run the following command to download all the dependent files mentioned in package.json file of the app package.
npm install
-
Once the dependent files are downloaded, run the below command to deploy the app package to your Microsoft 365 subscription. When prompted, log in to your AAD account.
npm run deploy
-
An AAD custom app, Bot are programmatically created in your tenant to power the Survey message extension app in Teams.
-
Once run, a Survey Teams app zip file is generated under output folder in the same directory as your cloned app repository locally with the name
microsoft-teams-survey-upload.zip
.
If your tenant has sideloading apps enabled, you can install your app by following the instructions here.
You can also upload it to your tenant's app catalog, so that it can be available for everyone in your tenant to install. See here.
Upload the generated Survey Teams app zip file (the microsoft-teams-survey-upload.zip
) under output folder in the same directory as your cloned app repository locally to your channel, chat, or tenant’s app catalog.
If you want to update the existing Survey Teams app with latest functionality -
-
Make sure you have cloned the latest app repository locally.
-
Open the
actionManifest.json
file in a text editor.- Change the placeholder fields (
packageID
,developer.name
,developer.websiteUrl
,developer.privacyUrl
,developer.termsOfUseUrl
) in the manifest with existing values in your Survey Teams app. - Update the
version
field in the manifest. Make sure latest version number is higher than previous version number.
- Change the placeholder fields (
-
Run the below command to update your Survey Teams app with the latest bits of code. When prompted, log in using your AAD account.
npm run update-teams-app
-
Your Survey app on Teams automatically gets updated to the latest version.
To create the Teams Survey app package:
-
Clone this app repository using command
git clone https://github.com/OfficeDev/microsoft-teams-apps-survey.git
or you can download and unzip it. -
Open the app repository folder and go to the folder named
bundle
. -
Open the
actionManifest.json
file in a text editor. You will find a couple of placeholder fields there which you need to update to values appropriate for your organization. Please note that all the URLs should begin withhttps://
.- packageID - A unique identifier for this app in reverse domain notation. E.g: com.contoso.surveyapp. (Max length: 64)
- developer.name (What's this?) - E.g: contoso
- developer.websiteUrl - (E.g:
https://<organization-url>
) - developer.privacyUrl - (E.g:
https://<organization-privacy-url>
) - developer.termsOfUseUrl - (E.g:
https://<organization-termsOfUse-url>
)
-
Navigate into the
bundle
folder. Select all the content inside the folder and create a ZIP file namedMSTeamsApp.zip
.
Note: Make sure you do not change to file structure of the bundle folder, with no new nested folders.
-
Open a Windows PowerShell console on your machine, to run PowerShell commands mentioned in subsequent steps. Following table help you to find PowerShell in your machine.
OS Version Location / Help Link Windows 10 Click left lower corner Windows icon, start typing PowerShell Windows 8, 7 and other versions Help Link Linux Help Link Mac Help Link -
Navigate to folder named
script
located in the cloned/downloaded repository usingcd
command.cd <cloned/downloaded local repository path>\script
-
If you have downloaded the app repository (not cloned), then run following PowerShell command to allow PowerShell script execution.
Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Force -Scope CurrentUser
-
Run the following command to import necessary module needed for deployment.
import-module .\ActionPackageDeploy.psm1
-
Run following PowerShell command to deploy the app package to your Microsoft 365 subscription.
MSTeamsApp.zip
created in Step 1 is used in this command.New-ActionPackage -PackageZipFilePath .\..\bundle\MSTeamsApp.zip
An AAD custom app, Bot are programmatically created in your tenant to power the Survey message extension app in Teams.
-
After successful execution of above command, You can find the downloaded Teams app at the path printed on your console.
If your tenant has sideloading apps enabled, you can install your app by following the instructions here.
You can also upload it to your tenant's app catalog, so that it can be available for everyone in your tenant to install. See here.
Upload the generated Survey Teams app zip file (the microsoft-teams-appzip-upload.zip
generated in above step) to your channel, chat, or tenant’s app catalog.
To update existing Survey Teams app package -
-
Make sure you have clone or download the latest app repository locally.
-
Open the app repository folder and go to the folder named
bundle
. -
Open the
actionManifest.json
file in a text editor.- Ensure that the placeholder fields match the existing values, otherwise the app will not get updated. To do this, open the manifest file and change fields (
packageID
,developer.name
,developer.websiteUrl
,developer.privacyUrl
,developer.termsOfUseUrl
) to existing values. - Update the
version
field in the manifest. Make sure latest version number is higher than previous version number. (E.g. If previous version is 1.0.0 then newer version can be 1.0.1 or 1.1.0)
- Ensure that the placeholder fields match the existing values, otherwise the app will not get updated. To do this, open the manifest file and change fields (
-
Zip all the content in the folder named
bundle
and name the zip file asMSTeamsApp.zip
. -
Perform following steps to update your Survey Teams app with the latest bits of code.
-
Navigate to script folder
cd <cloned/downloaded repository path>\script
-
Run command to import necessary modules to current PowerShell session
import-module .\ActionPackageDeploy.psm1
-
Run update command
Update-ActionPackage -PackageZipFilePath .\..\bundle\MSTeamsApp.zip
-
-
On success, your Survey app will automatically get updated to the latest version.
Please see our Troubleshooting page.