Sending email from a shared mailbox using service principal.

Sending email from a shared mailbox using service principal.

In the previous article, we saw how to configure a shared mailbox, in this article we'll see how to use a single service principal account to and not having to give everyone the "send-as" permissions.


Pre-requisites

  1. We need a service principal user with an exchange and a powerapps license, you should be able login to maker portal with this user.


Article content

Create a connection for outlook.

Open connections and create a new connection with the service principal.


Article content

Create a child flow for email.

You need to create a child flow (in a solution) for other flows to be able to send an email.


Article content

Ensure connection is set properly

Ensure that you're using the connection created using the service principal user.

Article content

Change the owner of the power automate

Make the service principal user as one of the owners of the flow.


Article content

Configure run-only users

This is the most important step. Find "Run only users" on the flow and click "Edit".


Article content

Once in edit mode, select "Office 365 outlook" and select the connection created in previous step.

Article content

Why is this needed

Because the power automate will run in the context of the running user as shown below. The child flow will inherit that, but, we can't give every user "send-as" outlook privilege, and hence we create a child flow and make it run in the context of a unique desired connection.

Article content

Give send-as permissions to the service principal

This is as shown in the previous article.

All set to send email under a single service principal.

To view or add a comment, sign in

More articles by Shashank Bhide

Insights from the community

Others also viewed

Explore topics