Čítať v angličtine Upraviť

Zdieľať cez

Build your first bot app using JavaScript

Prerequisites

Ensure you install the following tools for building and deploying your apps.

  Install For using...
Required    
  Teams Toolkit A Microsoft Visual Studio Code extension that creates a project scaffolding for your app. Use the latest version.
  Microsoft Teams Microsoft Teams to collaborate with everyone you work with through apps for chat, meetings, and call all in one place.
  Node.js Back-end JavaScript runtime environment. For more information, see Node.js version compatibility table for project type.
  Microsoft Edge (recommended) or Google Chrome A browser with developer tools.
  Visual Studio Code JavaScript, TypeScript, or SharePoint Framework (SPFx) build environments. Use the latest version.
Optional    
  Azure Tools for Visual Studio Code and Azure CLI Azure tools to access stored data or to deploy a cloud-based backend for your Teams app in Azure.
  React Developer Tools for Chrome OR React Developer Tools for Microsoft Edge A browser DevTools extension for the open-source React JavaScript library.
  Microsoft Graph Explorer Microsoft Graph Explorer, a browser-based tool that lets you run a query from Microsoft Graph data.
  Developer Portal for Teams Web-based portal to configure, manage, and distribute your Teams app including to your organization or the Microsoft Teams Store.

Tip

If you work with Microsoft Graph data, you should learn about and bookmark the Microsoft Graph Explorer. This browser-based tool allows you to query Microsoft Graph outside of an app.

Prepare development environment

After you install the required tools, set up the development environment.

Install Teams Toolkit

Microsoft Teams Toolkit helps simplify the development process with tools to provision and deploy cloud resources for your app and publish to the Teams Store.

You can use Teams Toolkit with Visual Studio Code or a command-line interface called TeamsFx CLI.

  1. Open Visual Studio Code and select Extensions (Ctrl+Shift+X or View > Extensions).

  2. In the search box, enter Teams Toolkit.

  3. Select Install.

    Screenshot shows the Teams Toolkit extension installation.

    The Teams Toolkit icon appears in the Visual Studio Code Activity Bar.

You can also install Teams Toolkit from the Visual Studio Code Marketplace.

Set up your Teams development tenant

A tenant is a space or a container for your organization in Teams, where you chat, share files, and run meetings. This space is also where you upload and test your app. Let's verify if you're ready to develop with the tenant.

Check for upload an app option

After creating your custom app, you must upload your app to Teams with the Upload a custom app option. Sign in to your Microsoft 365 account to check if this option is enabled.

The following steps help you verify if you can upload apps in Teams:

  1. In the Teams client, select the Apps icon.

  2. Select Manage your apps.

  3. Select Upload an app.

  4. Look for the option to Upload a custom app. If the option is visible, you can upload custom apps.

    Screenshot shows the option to upload a custom app in Teams.

    Poznámka

    If you don't find the option to upload a custom app, contact your Teams administrator.

Create a free Teams developer tenant (optional)

If you don't have a Teams developer account, join the Microsoft 365 developer program.

  1. Go to the Microsoft 365 developer program.

  2. Select Join Now and follow the onscreen instructions.

  3. In the welcome screen, select Set up E5 subscription.

  4. Set up your administrator account. After you finish, the following screen appears:

    Screenshot shows the Microsoft 365 Developer Program.

  5. Sign in to Teams using the administrator account you just set up. Verify that you have the Upload a custom app option in Teams.

Get a free Azure account

If you want to host your app or access resources in Azure, you must have an Azure subscription. Create a free account before you begin.

Now you've got all the tools to set up your account. Next, let's set up your development environment and start building! Select the app you want to create first.