This article helps us to understand the way to send emails without the user context. This could be applicable for applications, where consumers/users are non-licensed.
This could be achieved with the help of few set of actions on Power Automate flow. Here Microsoft graph end points are used to send emails on power automate, based on application permissions. The app permission needs to be enabled on Azure AD app.
Let us only look at the power automate configuration, instead of end-end business scenario. The following snapshot shows the actions.
Configure & Enable App Permission on Azure AD App
Create an application on Azure AD, to enable the application permission for sending emails. The below snapshot shows the permissions configured and granted admin consent.
Enable tokens on the Azure AD application.
From the azure AD app, extract the tenant ID, client ID and client secret.
Configure Power Automate Flow to Send Emails
The following set of actions are used in power automate.
- Trigger to start the power automate flow.
- Flow to call and get necessary token from Azure AD app –
- This is HTTP action, where Uri is auth token request endpoint, with necessary headers as shown.
- In the request body, client ID, client secret, grant type and resource details are configured as shown below.
- Receive and parse the token – Parse token action is used to parse the above response. The schema is generated with the help of body from above action.
- Send email action, where Microsoft graph send email end point is used, along with the above parsed token. The token is configured within authorization header.