Reader small image

You're reading from  Hands-On Microsoft Teams. - Second Edition

Product typeBook
Published inDec 2021
PublisherPackt
ISBN-139781801075275
Edition2nd Edition
Right arrow
Author (1)
João Ferreira
João Ferreira
author image
João Ferreira

João Ferreira is an acclaimed Microsoft MVP, MCP, and MCSA. João has been working with SharePoint for the last 9 years and embraced Microsoft Teams right from day one. João is responsible for the development of several products and is also the owner of 4 blogs: HANDS-ON tek, HANDS-ON SharePoint, HANDS-ON Teams, and HANDS-ON Lists.
Read more about João Ferreira

Right arrow

Building Your Own Bot for Microsoft Teams

Bots are powerful automated agents that can help you to do your daily tasks in an efficient way. You will be able to interact with these automated agents using natural language and they will reply to you in the same way. Bots can be used to replace repetitive tasks that are currently being executed manually, wasting productive time that could be used for other things. Things like requesting days off or submitting expenses can now be integrated into Microsoft Teams as a bot, with this new agent being able to make decisions based on the rules you've defined for it.

QnA Maker and Power Virtual Agents are both tools from Microsoft that allow you to build chat bots without writing code. QnA Maker is part of the Azure stack and provides advanced options that allow you to train the bot to learn how to interact with humans; it is, however, a bit more complex to configure for simple scenarios. Power Virtual Agents is part of the Power Platform...

Creating and packaging a bot using QnA Maker

Creating a bot for Microsoft Teams is only a few clicks away for any citizen developer using Microsoft QnA Maker, Microsoft Azure, and the Microsoft Teams Developer Portal.

Microsoft QnA Maker is a service that allows you to build and publish bots without writing code. Using an intelligent extraction system, it is able to get the information to be used by the bot from an Excel spreadsheet, a Word or PDF document, or even a website.

Before we begin creating our bot, you will need to have access to your organization's Microsoft Azure and you must be able to deploy custom apps on Microsoft Teams (see Chapter 9, Extending Microsoft Teams Using Apps).

Bot scenario: Peter, the HR manager

Peter manages HR in his organization and spends most of his day replying to questions from other employees. To save him time, Peter has compiled questions and replies in an Excel file, from which he copies them into Microsoft Teams...

Creating and packaging a bot using Power Virtual Agents

Microsoft provides different tools that allow you to rapidly create bots without writing code. We looked at QnA Maker in the previous section. Now we will have a look at Power Virtual Agents.

Note: Power Virtual Agents licensing

Power Virtual Agents is not included in Microsoft 365 plans – a separate license is required for it to work. More information about prices can be found on the Power Virtual Agents website at https://powervirtualagents.microsoft.com/pricing.

To get started with Power Virtual Agents, do the following:

  1. Open the sign-in page: https://powervirtualagents.microsoft.com.
  2. Sign in if you already have a license or start a trial by clicking on Sign up free or Start free:

    Figure 12.2.1: Signing in to Power Virtual Agents

  3. When you first log in to the Power Virtual Agents portal, you will be presented with the new chat bot wizard. On the Create a...

Using a bot in Microsoft Teams

Now that you have the bot installed on your tenant, you need to know how other members of the organization can interact with it.

First, let's see how to use the bot as a personal app. From the personal app bar, you will need to click on to expand the More apps section and click on the bot icon, as illustrated in Figure 12.3.1:

Figure 12.3.1: Installed bot on Microsoft Teams

Once you open the bot, you will be able to ask it private questions in a 1:1 chat without even mentioning the bot. Just type your question and wait for it to reply; replies are sent back in just a few seconds. You will find that this is one of the big advantages of using bots: unlike humans, you don't need to wait for someone else to read your question and reply back to you.

As you can see in the following screenshot, we have enabled the Chit-chat option, so the bot is able to reply to questions other than the ones that were uploaded from the...

Summary

In this chapter, you have learned how to build your own bot with artificial intelligence and without writing a single line of code, using both QnA Maker and Power Virtual Agents. You have also learned how to package the bot into a Microsoft Teams app, how to make it available in the tenant, and the ways you can use it to interact with users.

The last chapter of this book is for users that have an administrator role in their organization. It will cover Microsoft Teams PowerShell and will explain how you can automate tasks such as team creation in your organization using scripts.

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Hands-On Microsoft Teams. - Second Edition
Published in: Dec 2021Publisher: PacktISBN-13: 9781801075275
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime

Author (1)

author image
João Ferreira

João Ferreira is an acclaimed Microsoft MVP, MCP, and MCSA. João has been working with SharePoint for the last 9 years and embraced Microsoft Teams right from day one. João is responsible for the development of several products and is also the owner of 4 blogs: HANDS-ON tek, HANDS-ON SharePoint, HANDS-ON Teams, and HANDS-ON Lists.
Read more about João Ferreira