Automate Microsoft’s Teams Meetings using Custom Connector in Power Automate.

Vikrant SarodeDyn365CE4 years ago12 Views

I will show you a quick example of how to set up a service-to-service custom connector in Power Automate (MS Flow), which works with Microsoft Teams.

In my previous blog, I have shared how programmatically we can generate MS Teams meeting. Check out here: https://vikrantsdynamicsblogs.wordpress.com/2020/03/28/programmatically-create-the-teams-meeting/

In this blog you will learn, how to Automate MS Teams Meeting in Power automate without writing code.

To achieve this in Power automate we don’t have an inbuilt connector, which communicates with Graph API and generates Teams Meeting.

To overcome this problem we have the option to create a custom connector.

We can achieve this by doing below simple steps,

  1. Application registration and add permissions on the Azure portal.
  2. Create a custom connector.
  3. Use Custom Connector in Power Automate.

Let’s start step by step,

Register an Application and add permissions at the Azure portal.

To use Microsoft Graph (connects you to MS Teams), you need a registered application with an identity provider. Bunch of reasons behind this (read original thoughts here: https://www.oauth.com/oauth2-servers/background/), but as a summary: it makes life more secure and provides an extra layer to control permissions.

In Azure AD, you can register your application either as a web or a native app. Go with a web application, as that allows the service-to-service scenario.

Please follow below link for more info to register application: https://docs.microsoft.com/en-us/azure/active-directory/develop/quickstart-register-app

Once the app is registered, save Client ID and Client secret, we require this in future steps. 

 Now, hit the “API permissions” tab, and add Microsoft Graph with at least the “OnlineMeeting Read and write” permission.

Don’t forget to grand admin consent to newly added permission. (Azure admin will help you in this case).

Create a Custom Connector.

In the second step, log in to MS Flow: https://flow.microsoft.com/

Then on the left navigation, click on Data and then select Custom connectors, on top right corner you will see ‘+ new custom connector’ option, use it and create a blank connector.

(As a license, you need either: Flow Plan 1 // Flow Plan 2 // O365 Business Premium // a trial version)

Then provide the connector name and the properties you are required to fill are as follows.

  1. Upload connector icon (optional).
  2. Set Icon background color (optional).
  3. Select schema either HTTPS or HTTP based on your API (in my cas it is HTTPS).
  4. Then provide host URL as graph.microsoft.com

Now, while creating connector security is the most important part.

Let’s move to the security tab and the properties you are required to fill are as follows,

  1. Authentication type: OAuth 2.0
  2. Identity provider: Azure active directory.
  3. Client id: Azure Application client ID (Saved during the first step).
  4. Client secret: Azure Application secret ID (Saved during the first step).
  5. Login URL: keep it the same as it is.
  6. Tenant ID: common (keep it the same).
  7. Resource URL: https://graph.microsoft.com (As we are connecting to MS Graph API).
  8. Scope: https://graph.microsoft.com/.default

Once you filled up all required fields then click on create a connector. Redirect URL will get auto-populate.

Once the Redirect URL gets auto-populate, copy it and add it in our azure application under the Authentication tab.

This is the global redirect URL you can use: https://global.consent.azure-apim.net/redirect/

Our connector is created successfully, now time to setup the connector’s actions.

To setup actions, navigate to the definition tab and follow the below steps,

  1. Click on create action.
  2. Provide Summary, Description, Operation ID, and visibility as shown in the below screenshot.
  3. Click on “+ import from sample” under the Request section.
  4. Provide below details,
{
  "startDateTime":"2020-05-09T14:30:34.2444915-07:00",
  "endDateTime":"2020-05-09T15:00:34.2464912-07:00",
  "subject":"User Token Meeting11111"
}

Once you click on Import, you will see a new request is created with request URL, headers and request body, as below.

Next, move to the Test tab and click on a new connection, it will prompt one login screen, provide your credentials.

Provide start time, end time and subject of the meeting and click on Test operation, In Success response, you will able to see the meeting is generated with Meeting JoinUrl.

Create MS Flow using Custom connector.

Now the last and final step is how to use this connector in your flow.

To create flow navigate to https://make.powerapps.com/ and create blank flow as below.

Select the manual trigger and create 3 parameters as start time, end time, and subject. (For demonstration I am creating a manual trigger, you can trigger it on any action based on your requirements).

Then click on a new step, under the custom tab our newly created connector will get visible.

Select our connector and select the Create Teams Meeting’ action. (once you add multiple actions in your connector, automatically those will reflect here).

After selecting an action, then we have to setup dynamic values in input parameters as below,

Now, all set 🙂 , our flow is ready for the test, click the test button, and select I’ll perform the trigger action and click on Save & Test.

Provide values for start time, end time, and subject in input parameters and click on Run Flow.

Here you can see the success screen as below, and Teams meeting is generated automatically with join URL.

You can send this join URL to your customers and/or co-workers via email, to make their work easier and automated.

Using this connector you can also able to fetch User details, user group info, teams, calendar, Mail, Task, etc.  In Graph API’s there are multiple sub APIs you can use those and can achieve your requirements

Using this connector you can also able to fetch User details, user group info, teams, calendar, Mail, Task, etc.  In Graph API’s have multiple sub APIs, you can use those and can achieve your requirements easily, without coding.

Original Post https://vikrantsdynamicsblogs.wordpress.com/2020/05/10/automate-microsofts-teams-meetings-using-custom-connector-in-power-automate/

Leave a reply

Join Us
  • X Network2.1K
  • LinkedIn3.8k
  • Bluesky0.5K
Support The Site
Events
March 2025
MTWTFSS
      1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31       
« Feb   Apr »
Follow
Sign In/Sign Up Sidebar Search
Popular Now
Loading

Signing-in 3 seconds...

Signing-up 3 seconds...