https://github.com/sebastienlevert/kiota-demo
Kiota Demo
https://github.com/sebastienlevert/kiota-demo
Last synced: 3 months ago
JSON representation
Kiota Demo
- Host: GitHub
- URL: https://github.com/sebastienlevert/kiota-demo
- Owner: sebastienlevert
- License: apache-2.0
- Created: 2022-03-21T13:27:47.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-04-01T14:08:13.000Z (about 3 years ago)
- Last Synced: 2025-01-20T06:19:08.297Z (5 months ago)
- Language: TypeScript
- Size: 7.05 MB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Kiota Demo - Microsoft Teams App
Some instructions to make this work in your environment! It's still very early and requires "tweaks" to the project.
* `yarn`
* Copy the `.env.sample` file to a new `.env` file and fill the necessary information ([Use the following guide on how to get your app as an app available for SSO](https://docs.microsoft.com/en-us/microsoftteams/platform/tabs/how-to/authentication/auth-aad-sso?msclkid=7dacfce0b1c411ec9a10c6d6f73b1d32&tabs=dotnet))```
# Same as your CLIENT_ID
TAB_APP_ID=
# Export an API from your app in the format api://******.ngrok.io/CLIENT_ID
TAB_APP_URI=
# Azure AD App ID
CLIENT_ID=
# Your Dataverse Url (https://******.crm.dynamics.com)
DATAVERSE_URL=
# Your Dataverse API Url (https://******.crm.dynamics.com/api/data/v9.1)
DATAVERSE_API_URL=
```
* Locate the following file `node_modules/@microsoft/kiota-serialization-json/dist/es/jsonParseNodeFactory.js` and comment the first line.
* gulp ngrok-serve --debugThe current implementation of the Graph SDK is heavy and takes a lot of time to build (we're working on it), so we advise to debug builds as production builds can take a very (very!) long time!
## Getting started with Microsoft Teams Apps development
Head on over to [Microsoft Teams official documentation](https://developer.microsoft.com/en-us/microsoft-teams) to learn how to build Microsoft Teams Tabs or the [Microsoft Teams Yeoman generator docs](https://github.com/PnP/generator-teams/docs) for details on how this solution is set up.
## Project setup
All required source code are located in the `./src` folder:
* `client` client side code
* `server` server side code
* `public` static files for the web site
* `manifest` for the Microsoft Teams app manifestFor further details see the [Yo Teams documentation](https://github.com/PnP/generator-teams/docs)
## Building the app
The application is built using the `build` Gulp task.
``` bash
npm i -g gulp-cli
gulp build
```## Building the manifest
To create the Microsoft Teams Apps manifest, run the `manifest` Gulp task. This will generate and validate the package and finally create the package (a zip file) in the `package` folder. The manifest will be validated against the schema and dynamically populated with values from the `.env` file.
``` bash
gulp manifest
```## Deploying the manifest
Using the `yoteams-deploy` plugin, automatically added to the project, deployment of the manifest to the Teams App store can be done manually using `gulp tenant:deploy` or by passing the `--publish` flag to any of the `serve` tasks.
## Configuration
Configuration is stored in the `.env` file.
## Debug and test locally
To debug and test the solution locally you use the `serve` Gulp task. This will first build the app and then start a local web server on port 3007, where you can test your Tabs, Bots or other extensions. Also this command will rebuild the App if you change any file in the `/src` directory.
``` bash
gulp serve
```To debug the code you can append the argument `debug` to the `serve` command as follows. This allows you to step through your code using your preferred code editor.
``` bash
gulp serve --debug
```## Useful links
* [Debugging with Visual Studio Code](https://github.com/pnp/generator-teams/blob/master/docs/docs/vscode.md)
* [Developing with ngrok](https://github.com/pnp/generator-teams/blob/master/docs/docs/ngrok.md)
* [Developing with Github Codespaces](https://github.com/pnp/generator-teams/blob/master/docs/docs/codespaces.md)## Additional build options
You can use the following flags for the `serve`, `ngrok-serve` and build commands:
* `--no-linting` or `-l` - skips the linting of Typescript during build to improve build times
* `--debug` - builds in debug mode and significantly improves build time with support for hot reloading of client side components
* `--env .env` - use an alternate set of environment files
* `--publish` - automatically publish the application to the Teams App store## Deployment
The solution can be deployed to Azure using any deployment method.
* For Azure Devops see [How to deploy a Yo Teams generated project to Azure through Azure DevOps](https://www.wictorwilen.se/blog/deploying-yo-teams-and-node-apps/)
* For Docker containers, see the included `Dockerfile`## Logging
To enable logging for the solution you need to add `msteams` to the `DEBUG` environment variable. See the [debug package](https://www.npmjs.com/package/debug) for more information. By default this setting is turned on in the `.env` file.
Example for Windows command line:
``` bash
SET DEBUG=msteams
```If you are using Microsoft Azure to host your Microsoft Teams app, then you can add `DEBUG` as an Application Setting with the value of `msteams`.