Create a new Viva Engage Community with Graph

2024-04-02 | Toni Pohl

In early 2023, Microsoft renamed Yammer to Viva Engage. This year we see the first small integration of Viva Engage with Microsoft Graph in beta. This article shows how to provision a new Viva Engage community, add owners and members using Graph in an Azure Logic app.

The goal is to automatically create a new Viva Engage Community which means technically, to create a Microsoft 365 group that is enabled as – sorry, I'm still using the old name - Yammer Community. Currently, Microsoft Graph beta provides a preview feature. See the details at Use the Microsoft Graph API to work with Viva Engage (preview). When using this method, remember that APIs under the /beta version in Microsoft Graph are subject to change.

image

I tested the provisioning and adding owners and members with the beta API as described at Create community. Basically it works as expected, although there are currently a few small problems that I had to work around as follows.

So, here´s the step-by-step guide to create the new community, add owners, and add members.

The workaround of fetching the new group for getting the groupid and waiting for the new group to be available in Graph is currently required. However, this may no longer be necessary when this functionality is available in the v1 endpoint. This is the complete and working flow.

image

Create Community works as follows:

image

We use a Parse JSON action and a variable to easily work with the HTTP result in the following actions.

image

The action getgroup does the lookup of the newly created group. Again, we use Parse JSON to get the groupid and set it to a variable.

image

At the end, we add one member. Since the key value of the member body contains "@odata.id", I workarounded that with a concat('@','odata.id') function to avoid errors when saving the Logic App.

image

You can find the complete Azure Logic App for download in my GitHub repo AzureAndGraph here.

As result, this flow creates the new Viva Engage Community with the two owners, and one member.

image

I hope this article helps you use the preview version of Graph for Viva Engage sucessfully!

Categories: Azure, Cloud, Developer, English, Microsoft365, Microsoft, Office365, Yammer, Graph, Serverless, Tools

Source: https://blog.atwork.at/post/Create-a-new-Viva-Engage-Community-with-Graph