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
Create a connection for outlook.
Open connections and create a new connection with the service principal.
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.
Ensure connection is set properly
Ensure that you're using the connection created using the service principal user.
Change the owner of the power automate
Make the service principal user as one of the owners of the flow.
Configure run-only users
This is the most important step. Find "Run only users" on the flow and click "Edit".
Once in edit mode, select "Office 365 outlook" and select the connection created in previous step.
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.
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.