PVA Series – Add Power Virtual Agent to Teams

With the fresh release of Power Virtual Agent and its general availability (2nd December 2019) a bunch of new features were added to the tool. One of them is the functionality that allows us to publish the bot and use it in Teams for example. Or Messenger. Or Slack. Or …

Where can PVA be published?

Add Power Virtual Agent to Teams

Today there are two kinds of Channels. First has an integration interface allowing to easily set up PVA as a chatbot. Second doesn’t and require a Azure Bot Service as a hosting provider.

If you want to publish your PVA bot to Teams or Messenger – this is fairly easy, just a matter of couple of steps to follow, to make the configuration working.

For other, currently existing channels, so Skype, Cortana, Slack, Telegram, Twilio, Line, Kik, GroupMe, Speech and Email you need to use Azure Bot Service (as described here: https://docs.microsoft.com/en-us/power-virtual-agents/publication-connect-bot-to-azure-bot-service-channels).

How to publish PVA to Teams?

You can go through the documentation obviously ( https://docs.microsoft.com/en-us/power-virtual-agents/publication-add-bot-to-microsoft-teams), however I found it a little confusing. So here’s my guide.

Step no 1 – PVA

Publish

Once in Power Virtual Agent tool, navigate to “Publish” (1) and next hit “Publish” button (2). After publishing is done, hit the “Go to channels” (3) hyperlink.

Teams

Next click “Microsoft Teams” (1) tile. In the blade click “Add” (2) button and then, once processing is completed and App ID is generated, click “Copy” (3) button.

Step no 2 – Microsoft Teams

If you’re not a Tenant Admin, ensure with them that company policies allows you to sideload apps to Teams. Ask if this setting is set to “Allow all apps”:

Third party apps

If not, convince them to change this setting 😉 Because your bot won’t get to the store, therefore the second option: “Allow specific apps and block others” is not a solution here, as it only allows to select apps present inside the store.

Next thing, check if you have “App Studio” add-in installed in your Teams. It will be needed to generate apps manifest and to add Bot to channels/ chat.

App studio

Click the ellipsis icon (1) and check if you see “App Studio” (2) there. If not, click “More apps” (3) link, then type in “App Studio” in search field (4) and finally click the “App Studio” (5) tile and in opened modal window – button “Add”. Finally, open the application.

Create a new app

Then click “Manifest editor” and “Create a new app”.

App studio

Now fill in details in the “App details” tab. Be sure to provide information for all required fields. And you can set up branding too.

Important! Unfortunately, branding will not work for Bot created this way. The icon will only be visible in the list view of applications added to Teams. As a bot avatar, however, unfortunately not.

App Studio

Now navigate to “Bots” (1) settings. There click “Set up” (2). In the modal window click “Existing bot” (3). Then type in the name and App ID (4) copied from the Step 1, generated in the PVA “Channels” configuration. Lastly select Scopes (5) and “Save” (6) configuration.

Valid domains

Now go to “Domains and permissions” (1) section and input token.botframework.com as the “Valid domain” (2). Finally click “Add” (3).

App Studio

And finally, open “Test and distribute” (1) section to “Install” (2) Bot in your Teams:

Helpdesk Bot

Done!

And that’s it! Now you can go either to your chat or specific Teams Channel and start conversation with you Power Virtual Agent.

Watch the below video to see a detailed step-by-step guide:

Important!

I realized that there is some sort of an issue with re-authentication. So because the Bot is not working in user context, even though when using Teams you are obviously authenticated, Bot has no access to that. Therefore, when you use the “Authentication” functionality in Bot (read more here) you will need to follow the process no matter what.

And that works once you authenticate for the first time. Unfortunately, once your bearer token expires, Bot is not prompting you to log in again. Instead is still using old token, what makes ex. Power Automate to fail, since it gets access denied on calls requiring that token.

There is a list of known limitations in that integration: https://docs.microsoft.com/en-us/power-virtual-agents/publication-add-bot-to-microsoft-teams#known-limitations however that one issues is not there. I hope it gets resolved soon.

About the Author:

I’m Tomasz Poszytek, Microsoft Business Applications MVP. From more than 8 years now I’m being involved in projects, which aim is production of various applications using SharePoint as a platform. My adventure started absolutely without a purpose, when in the beginning of 2000 I was given FrontPage installation disc and started experimenting with this WYSWIG tool.  

Currently I’m focusing on self development in “cloud” area, where I’m trying to get acquainted with Office 365 features and applications. I’m professionally and personally very much interested in automation of processes, digital transformation, digital workplaces and all tools that helps employees in that area.

From more than a year I’m working with the platform for processes automation – Nintex. I’m also the Nintex Certified Partner and Nintex Virtual Technical Evangelist (Nintex vTE).

Reference:

Poszytek, T. (2020). PVA Series – Add Power Virtual Agent to Teams. Available at: https://poszytek.eu/en/microsoft-en/office-365-en/pva-en/pva-series-add-power-virtual-agent-to-teams/ [Accessed: 10th April 2020].

Share this on...

Rate this Post:

Share: