Skip to content

Files

Latest commit

 

History

History

stocks-update-notification-bot

page_type languages products name urlFragment description extensions
sample
typescript
office-teams
office
Stocks Update
officedev-teamsfx-samples-bot-stocks-update-notification-bot
Keep up to date with the latest stock price in Microsoft Teams.
createdDate
2022-08-08

Getting Started with Stocks Update Notification Bot

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.

Stocks Update Notification Bot

This sample illustrates

  • How to launch and debug an app using "F5" using Teams Toolkit for Visual Studio.
  • How to use a bot in different contexts

Prerequisite to use this sample

Minimal path to awesome

Run the app locally

  1. Clone the repo to your local workspace or directly download the source code.

  2. Open the project in Visual Studio Code.

  3. Update local environment variables in env/.env.local and env/.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 and env/.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.

  4. Start debugging the project by hitting the F5 key in Visual Studio Code.

Deploy the app to Azure

  1. Open Teams Toolkit, and sign into Azure by clicking the Sign in to Azure under the ACCOUNTS section from sidebar.
  2. Open the Teams Toolkit and click Provision from LIFECYCLE section or open the command palette and select: Teams: Provision.
  3. 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.

Preview the app in Teams

  1. Once deployment is completed, you can preview the app running in Azure. In Visual Studio Code, open Run and Debug and select Launch Remote (Edge) or Launch Remote (Chrome) in the dropdown list and Press F5 or green arrow button to open a browser.

Version History

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

Feedback

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!