Creating Viva Connections bot powered ACEs with Teams Toolkit
Viva Connections
Feb 2, 2025 6:31 PM

Creating Viva Connections bot powered ACEs with Teams Toolkit

by HubSite 365 about Microsoft

Software Development Redmond, Washington

Pro UserViva ConnectionsLearning Selection

Microsoft 365 Viva Connections Teams Toolkit Power Platform Adaptive Card Extensions SharePoint GitHub Community

Key insights

  • Viva Connections Bot Powered ACEs: Learn to create Adaptive Card Extensions using the Microsoft Teams Toolkit, enhancing employee engagement and productivity.

  • Development Environment Setup: Install necessary tools like Visual Studio Code, Microsoft Teams Toolkit version 5.10.0 or higher, and ensure an active Azure subscription for hosting the bot.

  • Create and Configure Bot Project: Use Visual Studio Code to scaffold a new bot project with TypeScript, rename files appropriately, and update dependencies such as the botbuilder package.

  • Implement Bot Logic: Modify your bot to handle ACE interactions by overriding methods like onSharePointTaskGetCardViewAsync and onSharePointTaskHandleActionAsync. Define unique IDs for ACE components.

  • App Manifest Update: Add a dashboardCards section in manifest.json to define your ACE settings, including validDomains for the bot's domain.

  • Provision, Deploy, and Publish: Utilize Microsoft Teams Toolkit commands to set up Azure resources, deploy your bot, and publish it in the Teams Developer Portal. Ensure correct configuration of Azure Bot settings.

Creating Viva Connections Bot-Powered ACEs with Teams Toolkit

Microsoft has released an informative YouTube video demonstrating how to create Viva Connections bot-powered Adaptive Card Extensions (ACEs) using the Teams Toolkit. Presented by Paolo Pialorsi, this demo highlights the integration of interactive, feedback-collecting bots within Viva Connections, ultimately enhancing employee engagement and productivity. This article will explore the key aspects of this process, the tools required, and the challenges involved in creating these bot-powered ACEs.

Understanding Bot-Powered Adaptive Card Extensions

Bot-Powered Adaptive Card Extensions (ACEs) for Microsoft Viva Connections allow developers to extend the Microsoft Viva Connections Dashboard using the bot development model. From a development perspective, a Bot-Powered ACE functions similarly to a regular client-side ACE built with the SharePoint Framework (SPFx). Developers can render Card Views, Quick Views, provide configurable properties via a Property Pane, and implement specific behaviors to handle actions in the user interface of the ACE.

Bot-Powered ACEs can be developed using either C# and .NET or TypeScript and Node.js. This tutorial focuses on building a basic Bot-Powered ACE using the Microsoft Teams Toolkit in Visual Studio Code and TypeScript. The goal is to create a bot that collects user feedback through a Card View with a textbox and a submission button. This approach allows developers to build the ACE once and benefit from it in both desktop and mobile environments.

Setting Up the Development Environment

To develop a Bot-Powered ACE with Microsoft Teams Toolkit and TypeScript, certain tools and packages must be installed on the development machine:

  • Microsoft Visual Studio Code
  • Microsoft Teams Toolkit version 5.10.0 or higher
  • An active and valid Microsoft Azure subscription to host the Azure Bot

Once the development environment is set up, developers can start Visual Studio Code, select the Microsoft Teams Toolkit icon on the command bar, and choose the "Create a New App" button to begin scaffolding the solution. The process involves selecting the "Bot" option, choosing "Basic Bot," and specifying TypeScript as the programming language.

Implementing the Bot Logic

After setting up the development environment, the next step is to implement the bot logic. This involves renaming the teamsBot.ts file to YourBotNameBot.ts (replacing YourBotName with the preferred name) and updating the class name within the file to match the new filename. Additionally, developers need to upgrade the botbuilder package to version 4.23.1 or higher and install any additional dependencies using npm.

The bot must be modified to inherit from SharePointActivityHandler instead of TeamsActivityHandler. Developers must override necessary methods to handle ACE interactions, such as onSharePointTaskGetCardViewAsync, onSharePointTaskGetQuickViewAsync, and onSharePointTaskHandleActionAsync. Unique IDs for the ACE and its components must be defined, and card views and quick views managed as needed.

Updating the App Manifest

Once the bot logic is implemented, the app manifest must be updated. This involves opening the manifest.json file located in the appPackage folder and adding a dashboardCards section to define the ACE. The validDomains section must also include the bot’s domain to ensure proper configuration.

The dashboardCards section defines the settings for Bot-Powered ACEs, including the ID of the Microsoft App backing the Azure Bot, the display name and description of the ACE, and the icon as a Fluent UI Icon. It also specifies the bot that handles requests and the default size for the ACE in the Viva Connections Dashboard.

Provisioning, Deploying, and Publishing

Before running and testing the Bot-Powered ACE, developers need to provision resources in Microsoft Azure, deploy the solution in the Teams Developer Portal, and publish it. The Microsoft Teams Toolkit simplifies this process by handling provisioning, deploying, and publishing the bot solution.

The provisioning stage involves creating an app in Microsoft Entra ID, provisioning a Web App in Microsoft Azure, and provisioning the Azure Bot. The deploy stage installs all npm dependencies, builds the solution, and deploys it on the Web App in Microsoft Azure. Finally, the publish stage validates and packages the manifest.json file and updates the generated package in the Teams Developer Portal.

It is crucial to update the provisioning templates to support additional configuration settings, enabling the publishing of custom images with the Bot web application. Once provisioning is complete, developers can deploy and publish the solution, allowing the Bot-Powered ACE to appear in the Microsoft Viva Connections Dashboard within 24 hours.

Testing and Validation

After publishing the Bot-Powered ACE, it is essential to test its functionality in both desktop and mobile environments to ensure a consistent user experience. Developers should verify that the ACE appears in the Viva Connections Dashboard and functions as expected, collecting user feedback and rendering Card Views and Quick Views correctly.

Additionally, developers must configure the Azure Bot in the Azure Management Portal, ensuring that the Microsoft 365 channel is enabled. This configuration allows the bot to operate seamlessly within the Microsoft 365 ecosystem, providing a robust solution for collecting feedback and enhancing employee engagement.

Conclusion

Creating Viva Connections bot-powered ACEs with Teams Toolkit offers a powerful way to enhance employee engagement and productivity. By following the steps outlined in this article, developers can successfully build, deploy, and test Bot-Powered ACEs, leveraging the capabilities of Microsoft Teams Toolkit and Azure Bot Services. While the process involves several stages and configurations, the result is a dynamic and interactive solution that integrates seamlessly with Microsoft Viva Connections.

For further information and detailed walkthroughs, developers are encouraged to refer to the official Microsoft documentation and explore additional resources on Bot-Powered Adaptive Card Extensions.

Viva Connections - Viva Connections: Boost Engagement with ACE-Powered Bots Using Teams Toolkit

Keywords

Viva Connections bot Teams Toolkit ACEs SEO Microsoft 2025 integration development tutorial