Run local - OfficeDev/microsoft-teams-apps-sustain GitHub Wiki
Teams Sustain App
Prerequisites
- Visual Studio 2022
- VS Code
- OpenSSL
- Node JS
- Teams Account with side-loading enabled, please see this link more information about side-loading an application.
- App Registration
- A developer tenant with O365 subscription and Teams side-loading app enabled
To try this sample
API
- Checkout latest codes from the repository
- Modify configuration files (if needed), below are the common configurations that needs changes:
- AzureAd
- BlobStorage
- PnPCore
- ConnectionStrings.Sustainability
- Sign in to Azure CLI using PowerShell with the "az login" command
- Run API
React App
- Download and Install OpenSSL
- Run the following commands
openssl req -x509 -sha256 -nodes -days 365 -newkey rsa:2048 -keyout TeamsAppDev.key -out TeamsAppDev.crt -subj "/CN=TeamsAppDev" -addext "subjectAltName = DNS:dev.teamsapps.local"
-
Create ".certs" folder in webui project
-
Move certificates to that directory
-
Modify hosts files located at: "C:\Windows\System32\drivers\etc"
- Run notepad as administrator
- Navigate to the directory and open the hosts file
- Add needed items to hosts file
- Add "127.0.0.1 dev.teamsapps.local" to hosts file
- Import certificates to "ctrmgr"
- Type certmgr on cmd
- Go to Trusted Root Certification Authorities/Certificates
- Right to Certificates folder, select all tasks -> import
- navigate to WebUI project
- npm install
- npm start
- navigate to manifest on "dev-dturley" folder and edit manifest.json
- Change client Id
- Add :3000 to resource
- Drag manifest.json to zip file
- Sideload to teams
- Upload custom app and select the latest zip file
- Go to .../About/Developer Preview
- Switch to developer view (Optional)
- On the top right corner of Teams App.
- Navigate to About > Developer View
- After switching to Developer View, right click to Teams App Icon and open dev tools