Skip to content
This repository was archived by the owner on Jun 18, 2024. It is now read-only.

Commit dbfc07c

Browse files
committed
Add MSTeams module "50 Task Modules"
1 parent bc840ba commit dbfc07c

File tree

105 files changed

+35946
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+35946
-1
lines changed

Teams/50 Task Modules/01.pptx

13.9 MB
Binary file not shown.

Teams/50 Task Modules/02.pptx

10.8 MB
Binary file not shown.

Teams/50 Task Modules/03.pptx

10.9 MB
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[config]
2+
command = deploy.cmd
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# The domain name of where you host your application
2+
HOSTNAME=youtubeplayer.azurewebsites.net
3+
4+
# App Id and App Password ofr the Bot Framework bot
5+
MICROSOFT_APP_ID=
6+
MICROSOFT_APP_PASSWORD=
7+
8+
# Port for local debugging
9+
PORT=3007
10+
11+
# Security token for the default outgoing webhook
12+
SECURITY_TOKEN=
13+
14+
# ID of the Outlook Connector
15+
CONNECTOR_ID=
16+
17+
# Application Insights instrumentation key
18+
APPINSIGHTS_INSTRUMENTATIONKEY=
19+
20+
# NGROK configuration for development
21+
# NGROK authentication token (leave empty for anonymous)
22+
NGROK_AUTH=
23+
# NGROK sub domain. ex "myapp" or (leave empty for random)
24+
NGROK_SUBDOMAIN=
25+
# NGROK region. (us, eu, au, ap - default is us)
26+
NGROK_REGION=
27+
28+
# Debug settings, default logging "msteams"
29+
DEBUG=msteams
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# do not include the node modules in Git
2+
node_modules
3+
4+
# do not include the package in Git
5+
package
6+
7+
# do not include the local environment files
8+
.env
9+
10+
# do not include the Connectors Json Db file
11+
connectors.json
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"generator-teams": {
3+
"promptValues": {
4+
"developer": "Contoso",
5+
"unitTestsEnabled": false,
6+
"useAzureAppInsights": false
7+
},
8+
"libraryName": "youTubePlayer",
9+
"generator-version": "2.11.1"
10+
}
11+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Demo: Collecting User Input with Task Modules
2+
3+
This completed project is the result of the lab exercise **Collecting User Input with Task Modules** that is referenced in the [README](./../../README.md) in this repo.
4+
5+
## Prerequisites
6+
7+
Developing Microsoft Teams apps requires an Office 365 tenant, Microsoft Teams configured for development, and the necessary tools installed on your workstation.
8+
9+
For the Office 365 tenant, follow the instructions on [Microsoft Teams: Prepare your Office 365 tenant](https://docs.microsoft.com/microsoftteams/platform/get-started/get-started-tenant) for obtaining a developer tenant if you do not currently have an Office 365 account and to enable Microsoft Teams for your organization.
10+
11+
In order to build custom apps for Microsoft Teams, you must configure Microsoft Teams to enable custom apps and allow custom apps to be uploaded to your tenant. Follow the instructions on the same **Prepare your Office 365 tenant** page mentioned above.
12+
13+
In this module, you will use Node.js to create custom Microsoft Teams tabs. The exercises in this module assume you have the following tools installed on your developer workstation.
14+
15+
> [!IMPORTANT]
16+
> In most cases, installing the latest version of the following tools is the best option. The versions listed here were used when this module was published and last tested.
17+
18+
- [Node.js](https://nodejs.org/) - v10.\* (or higher)
19+
- NPM (installed with Node.js) - v6.\* (or higher)
20+
- [Gulp](https://gulpjs.com/) - v4.\* (or higher)
21+
- [Yeoman](https://yeoman.io/) - v3.\* (or higher)
22+
- [Yeoman Generator for Microsoft Teams](https://github.com/OfficeDev/generator-teams) - v2.\* (or higher)
23+
- [Visual Studio Code](https://code.visualstudio.com)
24+
25+
If you do not have the minimum versions of these prerequisites installed on your workstation, follow the install instructions for each of these tools before proceeding with the exercise.
26+
27+
## Run this Completed Project
28+
29+
- Download the required dependencies for this project by executing the following command in the console:
30+
31+
```shell
32+
npm install
33+
```
34+
35+
- Rename the file **.env.example** to **.env**. You do not need to edit any values in this file unless you have an existing ngrok license with a reserved subdomain name & auth key. These are only available to paid paid ngrok accounts, but it is not necessary to run the demo.
36+
- Download the required dependencies for this project by executing the following command in the console:
37+
38+
```shell
39+
gulp ngrok-serve
40+
```
41+
42+
- In a browser, navigate to **https://teams.microsoft.com** and sign in with the credentials of a Work and School account.
43+
- Using the app bar navigation menu, select the **Mode added apps** button. Then select **Browse all apps** followed by **Upload for me or my teams**.
44+
- In the file dialog that appears, select the Microsoft Teams package in your project. This app package is a ZIP file that can be found in the project's **./package** folder.
45+
- Select the **Add** button to install the app. This will add a new personal tab to your **More added apps** dialog.
46+
- Select the app to navigate to the new tab.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
@if "%SCM_TRACE_LEVEL%" NEQ "4" @echo off
2+
3+
:: ----------------------
4+
:: KUDU Deployment Script
5+
:: Version: 1.0.9
6+
:: ----------------------
7+
8+
:: Prerequisites
9+
:: -------------
10+
11+
:: Verify node.js installed
12+
where node 2>nul >nul
13+
IF %ERRORLEVEL% NEQ 0 (
14+
echo Missing node.js executable, please install node.js, if already installed make sure it can be reached from current environment.
15+
goto error
16+
)
17+
18+
:: Setup
19+
:: -----
20+
21+
setlocal enabledelayedexpansion
22+
23+
SET ARTIFACTS=%~dp0%..\artifacts
24+
25+
IF NOT DEFINED DEPLOYMENT_SOURCE (
26+
SET DEPLOYMENT_SOURCE=%~dp0%.
27+
)
28+
29+
IF NOT DEFINED DEPLOYMENT_TARGET (
30+
SET DEPLOYMENT_TARGET=%ARTIFACTS%\wwwroot
31+
)
32+
33+
IF NOT DEFINED NEXT_MANIFEST_PATH (
34+
SET NEXT_MANIFEST_PATH=%ARTIFACTS%\manifest
35+
36+
IF NOT DEFINED PREVIOUS_MANIFEST_PATH (
37+
SET PREVIOUS_MANIFEST_PATH=%ARTIFACTS%\manifest
38+
)
39+
)
40+
41+
IF NOT DEFINED KUDU_SYNC_CMD (
42+
:: Install kudu sync
43+
echo Installing Kudu Sync
44+
call npm install kudusync -g --silent
45+
IF !ERRORLEVEL! NEQ 0 goto error
46+
47+
:: Locally just running "kuduSync" would also work
48+
SET KUDU_SYNC_CMD=%appdata%\npm\kuduSync.cmd
49+
)
50+
goto Deployment
51+
52+
:: Utility Functions
53+
:: -----------------
54+
55+
:SelectNodeVersion
56+
57+
IF DEFINED KUDU_SELECT_NODE_VERSION_CMD (
58+
:: The following are done only on Windows Azure Websites environment
59+
call %KUDU_SELECT_NODE_VERSION_CMD% "%DEPLOYMENT_SOURCE%" "%DEPLOYMENT_TARGET%" "%DEPLOYMENT_TEMP%"
60+
IF !ERRORLEVEL! NEQ 0 goto error
61+
62+
IF EXIST "%DEPLOYMENT_TEMP%\__nodeVersion.tmp" (
63+
SET /p NODE_EXE=<"%DEPLOYMENT_TEMP%\__nodeVersion.tmp"
64+
IF !ERRORLEVEL! NEQ 0 goto error
65+
)
66+
67+
IF EXIST "%DEPLOYMENT_TEMP%\__npmVersion.tmp" (
68+
SET /p NPM_JS_PATH=<"%DEPLOYMENT_TEMP%\__npmVersion.tmp"
69+
IF !ERRORLEVEL! NEQ 0 goto error
70+
)
71+
72+
IF NOT DEFINED NODE_EXE (
73+
SET NODE_EXE=node
74+
)
75+
76+
SET NPM_CMD="!NODE_EXE!" "!NPM_JS_PATH!"
77+
) ELSE (
78+
SET NPM_CMD=npm
79+
SET NODE_EXE=node
80+
)
81+
82+
goto :EOF
83+
84+
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
85+
:: Deployment
86+
:: ----------
87+
88+
:Deployment
89+
echo Handling node.js deployment.
90+
91+
92+
93+
:: 1. Select node version for build
94+
call :SelectNodeVersion
95+
96+
:: 2. Install npm packages
97+
IF EXIST "%DEPLOYMENT_SOURCE%\package.json" (
98+
pushd "%DEPLOYMENT_SOURCE%"
99+
call :ExecuteCmd !NPM_CMD! install --production
100+
IF !ERRORLEVEL! NEQ 0 goto error
101+
popd
102+
)
103+
:: 3. Build it
104+
IF EXIST "%DEPLOYMENT_SOURCE%\package.json" (
105+
pushd "%DEPLOYMENT_SOURCE%"
106+
call :ExecuteCmd !NPM_CMD! run-script build
107+
IF !ERRORLEVEL! NEQ 0 goto error
108+
popd
109+
)
110+
111+
112+
113+
:: 4. KuduSync
114+
IF /I "%IN_PLACE_DEPLOYMENT%" NEQ "1" (
115+
call :ExecuteCmd "%KUDU_SYNC_CMD%" -v 50 -f "%DEPLOYMENT_SOURCE%" -t "%DEPLOYMENT_TARGET%" -n "%NEXT_MANIFEST_PATH%" -p "%PREVIOUS_MANIFEST_PATH%" -i ".git;.hg;.deployment;deploy.cmd"
116+
IF !ERRORLEVEL! NEQ 0 goto error
117+
)
118+
119+
:: 5. Select node version for run
120+
call :SelectNodeVersion
121+
122+
123+
124+
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
125+
goto end
126+
127+
:: Execute command routine that will echo out when error
128+
:ExecuteCmd
129+
setlocal
130+
set _CMD_=%*
131+
call %_CMD_%
132+
if "%ERRORLEVEL%" NEQ "0" echo Failed exitCode=%ERRORLEVEL%, command=%_CMD_%
133+
exit /b %ERRORLEVEL%
134+
135+
:error
136+
endlocal
137+
echo An error has occurred during web site deployment.
138+
call :exitSetErrorLevel
139+
call :exitFromFunction 2>nul
140+
141+
:exitSetErrorLevel
142+
exit /b 1
143+
144+
:exitFromFunction
145+
()
146+
147+
:end
148+
endlocal
149+
echo Finished successfully.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
const config = {
2+
injectSources: [
3+
"./dist/web/scripts/**/*.js",
4+
"./dist/web/styles/**/*.css"
5+
],
6+
staticFiles: [
7+
"./src/app/**/*.html",
8+
"./src/app/**/*.ejs",
9+
"./src/app/web/assets/**/*"
10+
],
11+
htmlFiles: [
12+
"./src/app/**/*.html", "./src/app/**/*.ejs"
13+
],
14+
watches: [
15+
"./src/app/**/*.*",
16+
"!./src/app/**/*.scss",
17+
"!./src/app/web/**/*.*",
18+
"!./src/app/scripts/**/*.*",
19+
],
20+
clientWatches: [
21+
"./src/app/scripts/**/*.*",
22+
"!./src/app/**/*.scss"
23+
],
24+
manifests: [
25+
"./src/manifest/**/*.*",
26+
'!**/manifest.json'
27+
],
28+
temp: [
29+
"./temp"
30+
],
31+
// Supported Schemas
32+
SCHEMAS: [{
33+
version: "1.3",
34+
schema: "https://developer.microsoft.com/en-us/json-schemas/teams/v1.3/MicrosoftTeams.schema.json"
35+
},
36+
{
37+
version: "1.4",
38+
schema: "https://developer.microsoft.com/en-us/json-schemas/teams/v1.4/MicrosoftTeams.schema.json"
39+
},
40+
{
41+
version: "devPreview",
42+
schema: "https://raw.githubusercontent.com/OfficeDev/microsoft-teams-app-schema/preview/DevPreview/MicrosoftTeams.schema.json"
43+
},
44+
{
45+
version: "1.5",
46+
schema: "https://developer.microsoft.com/en-us/json-schemas/teams/v1.5/MicrosoftTeams.schema.json"
47+
}
48+
],
49+
// This is the name of the packaged manifest file
50+
manifestFileName: "YouTubePlayer.zip"
51+
};
52+
53+
module.exports = config;

0 commit comments

Comments
 (0)