Skip to content

Commit

Permalink
[JS] docs: update 06.auth.teamsSSO.messageExtension setup guide (#999)
Browse files Browse the repository at this point in the history
## Linked issues

closes: #984 

## Details

1. Change teams-ai dependency to remote version
2. Update wording
3. Provide differences comparing with other auth sample
4. Change link to relative path
5. Remove install dependency step from `teamsapp.local.yml`

## Attestation Checklist

- [x] My code follows the style guidelines of this project

- I have checked for/fixed spelling, linting, and other errors
- I have commented my code for clarity
- I have made corresponding changes to the documentation (we use
[TypeDoc](https://typedoc.org/) to document our code)
- My changes generate no new warnings
- I have added tests that validates my changes, and provides sufficient
test coverage. I have tested with:
  - Local testing
  - E2E testing in Teams
- New and existing unit tests pass locally with my changes
  • Loading branch information
blackchoey authored Dec 4, 2023
1 parent e122a67 commit d8eaa6a
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 9 deletions.
8 changes: 5 additions & 3 deletions js/samples/06.auth.teamsSSO.messageExtension/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

This sample shows how to incorporate a basic Message Extension app with SSO into a Microsoft Teams application using [Bot Framework](https://dev.botframework.com) and the Teams AI SDK. Users can search npmjs for packages.

This sample depends on Teams SSO and gives you more flexibility on how to configure AAD, like using a client certificate. There is no need to create an OAuth Connection in Azure Bot Service to run this sample.

## Showcase
- Message Extensions are convenient ways to add functionality to Teams.
- This sample adds a search command to the compose area of a chat.
Expand Down Expand Up @@ -54,7 +56,7 @@ Teams Toolkit automates the setup of Azure Bot Resources and provides a local de
1. Select **File > Open Folder** in VS Code and choose this sample's directory from the repo
- Running the debugger from the root of the repo will not work - you must open a new window at the sample's root.
1. Using the TTK extension, sign in with your Microsoft 365 account where you have permissions to upload custom apps to Teams.
1. Further, detailed instructions can be found at [Getting Started - Teams Toolkit](https://github.com/microsoft/teams-ai/tree/main/getting-started/OTHER/TEAMS-TOOLKIT.md)
1. Further, detailed instructions can be found at [Getting Started - Teams Toolkit](../../../getting-started/OTHER/TEAMS-TOOLKIT.md)
1. Select **Debug > Start Debugging** or **F5** to run the app in a Teams web client (in Microsoft Edge).
1. In the browser that launches, select the **Add** button to install the app to Teams.

Expand All @@ -64,14 +66,14 @@ Teams Toolkit automates the setup of Azure Bot Resources and provides a local de

In a chat window (not the bot's chat window) select the app's icon in the chat compose area. This opens a dialog that allows you to search NPM for a package. Selecting a package will output an Adaptive Card with it's description to the chat.
If you type `profile` in the Message Extension's search box to show the current user's profile in search result.
If you type `profile` in the Message Extension's search box, it will show your profile in search result.

## Other ways to run the sample
### Teams Toolkit CLI

[TeamsFx command line interface](https://learn.microsoft.com/microsoftteams/platform/toolkit/teamsfx-cli?pivots=version-two) is a text-based command line interface that accelerates Teams application development. It aims to provide keyboard centric experience while building Teams applications.

Navigate to [Teams Toolkit CLI](https://github.com/microsoft/teams-ai/tree/main/getting-started/OTHER/TEAMS-TOOLKIT.md#teams-toolkit-cli) for setup instructions.
Navigate to [Teams Toolkit CLI](../../../getting-started/OTHER/TEAMS-TOOLKIT-CLI.md) for setup instructions.

### Manual resource management and uploading to Teams

Expand Down
21 changes: 21 additions & 0 deletions js/samples/06.auth.teamsSSO.messageExtension/env/.env.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# This file includes environment variables that will be committed to git by default.
# Built-in environment variables
TEAMSFX_ENV=dev
APP_NAME_SUFFIX=dev 

# Updating AZURE_SUBSCRIPTION_ID or AZURE_RESOURCE_GROUP_NAME after provision may also require an update to RESOURCE_SUFFIX, because some services require a globally unique name across subscriptions/resource groups.
AZURE_SUBSCRIPTION_ID=
AZURE_RESOURCE_GROUP_NAME=
RESOURCE_SUFFIX= 

# Generated during provision, you can also add your own variables. If you're adding a secret value, add SECRET_ prefix to the name so Teams Toolkit can handle them properly
BOT_ID=
BOT_DOMAIN=
AAD_APP_CLIENT_ID=
AAD_APP_OBJECT_ID=
AAD_APP_TENANT_ID=
AAD_APP_OAUTH_AUTHORITY=
AAD_APP_OAUTH_AUTHORITY_HOST=
TEAMS_APP_ID=
TEAMS_APP_TENANT_ID=
AAD_APP_ACCESS_AS_USER_PERMISSION_ID=
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# This file includes environment variables that will not be committed to git by default. You can set these environment variables in your CI/CD system for your project.

# If you're adding a secret value, add SECRET_ prefix to the name so Teams Toolkit can handle them properly
SECRET_AAD_APP_CLIENT_SECRET=
SECRET_BOT_PASSWORD=
18 changes: 18 additions & 0 deletions js/samples/06.auth.teamsSSO.messageExtension/env/.env.local
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# This file includes environment variables that can be committed to git. It's gitignored by default because it represents your local development environment.

# Built-in environment variables
TEAMSFX_ENV=local 
APP_NAME_SUFFIX=local

# If you're adding a secret value, add SECRET_ prefix to the name so Teams Toolkit can handle them properly
BOT_ID=
BOT_ENDPOINT=
BOT_DOMAIN=
AAD_APP_CLIENT_ID=
AAD_APP_OBJECT_ID=
AAD_APP_TENANT_ID=
AAD_APP_OAUTH_AUTHORITY=
AAD_APP_OAUTH_AUTHORITY_HOST=
TEAMS_APP_ID=
TEAMS_APP_TENANT_ID=
AAD_APP_ACCESS_AS_USER_PERMISSION_ID=
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# This file includes environment variables that will not be committed to git by default. You can set these environment variables in your CI/CD system for your project.

# Generated during provision, you can also add your own variables. If you're adding a secret value, add SECRET_ prefix to the name so Teams Toolkit can handle them properly
SECRET_AAD_APP_CLIENT_SECRET=
SECRET_BOT_PASSWORD=
2 changes: 1 addition & 1 deletion js/samples/06.auth.teamsSSO.messageExtension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
},
"dependencies": {
"@microsoft/microsoft-graph-client": "^3.0.7",
"@microsoft/teams-ai": "file:../../packages/teams-ai",
"@microsoft/teams-ai": "~1.0.0-preview.1",
"botbuilder": "^4.21.0",
"dotenv": "^16.3.1",
"isomorphic-fetch": "^3.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,6 @@ provision:
# Defines what the `deploy` lifecycle step does with Teams Toolkit.
# Runs after `provision` during Start Debugging (F5) or run manually using `teamsfx deploy --env local`.
deploy:
# Ensures that the project dependnecies are installed.
- uses: cli/runNpmCommand
with:
args: install --no-audit

# Provides the Teams Toolkit .env file values to the apps runtime so they can be accessed with `process.env`.
- uses: file/createOrUpdateEnvironmentFile
with:
Expand Down

0 comments on commit d8eaa6a

Please sign in to comment.