page_type | languages | products | name | urlFragment | description | extensions | |||||
---|---|---|---|---|---|---|---|---|---|---|---|
sample |
|
|
Stocks Update |
officedev-teamsfx-samples-bot-stocks-update-notification-bot |
Keep up to date with the latest stock price in Microsoft Teams. |
|
Bots can be used to deliver pro-active messages into different Microsoft Teams contexts, such as a personal bot chat, one to one or group chat, or a channel conversation.
The Stocks Update Notification bot shows you how to request data on a pretermined schedule from a public API using API Key authentication and render that data using an Adaptive Card in different Microsoft Teams contexts.
- How to launch and debug an app using "F5" using Teams Toolkit for Visual Studio.
- How to use a bot in different contexts
- Node.js, supported versions: 18, 20, 22
- A Microsoft 365 account. If you do not have Microsoft 365 account, apply one from Microsoft 365 developer program
- Teams Toolkit Visual Studio Code Extension version 5.0.0 and higher or Teams Toolkit CLI
-
Clone the repo to your local workspace or directly download the source code.
-
Open the project in Visual Studio Code.
-
Update local environment variables in
env/.env.local
andenv/.env.local.user
For the HTTP request to the public API to be succesful, the following environment variables need to be configured in the
env/.env.local
andenv/.env.local.user
files.# env/.env.local TEAMSFX_API_ALPHAVANTAGE_ENDPOINT=https://www.alphavantage.co # env/.env.local.user for secret TEAMSFX_API_ALPHAVANTAGE_API_KEY=demo
The demo key will not update values, you can sign up for a free key for the Alpha Vantage service and update the
TEAMSFX_API_ALPHAVANTAGE_API_KEY
setting with your own key. -
Start debugging the project by hitting the
F5
key in Visual Studio Code.
- Open Teams Toolkit, and sign into Azure by clicking the
Sign in to Azure
under theACCOUNTS
section from sidebar. - Open the Teams Toolkit and click
Provision
from LIFECYCLE section or open the command palette and select:Teams: Provision
. - Open the Teams Toolkit and Click
Deploy
or open the command palette and select:Teams: Deploy
.
Note: Provisioning and deployment may incur charges to your Azure Subscription.
- Once deployment is completed, you can preview the app running in Azure. In Visual Studio Code, open
Run and Debug
and selectLaunch Remote (Edge)
orLaunch Remote (Chrome)
in the dropdown list and PressF5
or green arrow button to open a browser.
Date | Author | Comments |
---|---|---|
Aug 19, 2022 | garrytrinder | update to support Teams Toolkit V4.0.0 |
Dec 5, 2022 | XiaofuHuang | update to support Teams Toolkit v5.0.0 |
We really appreciate your feedback! If you encounter any issue or error, please report issues to us following the Supporting Guide. Meanwhile you can make recording of your journey with our product, they really make the product better. Thank you!