How to Configure Azure AD Service Principal to Send Emails from Mailbox via Logic App?

Bishal Das 0 Reputation points
2024-12-11T05:54:11.9033333+00:00

I have created a Service Principal in Azure AD, and I want it to be able to send emails from its mailbox. This is for an upcoming Logic App that I am building, where I need the Service Principal to send emails to recipients with log ingestion reports.

Could anyone guide me on how to configure the Service Principal to send emails? Specifically, I'm looking for the correct permissions and steps needed to allow the Service Principal to interact with the mailbox and send messages via the Logic App.

Thanks in advance for your help!

Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
3,275 questions
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,653 questions
Azure Advisor
Azure Advisor
An Azure personalized recommendation engine that helps users follow best practices to optimize Azure deployments.
70 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Yakun Huang-MSFT 8,355 Reputation points Microsoft Vendor
    2024-12-11T09:22:23.8766667+00:00

    Hello Bishal Das,

    Thank you for reaching out to Microsoft Support!

    Depending on your needs, it is recommended that you use the Graph API to send email.

    When using the Graph API, you first need to grant the application permission. You can grant the application permission Mail.Send, and then get the token. See the documentation for details:

    User's image

    Screenshot 2024-12-11 091559

    The obtained token can then be used to request the sendMail endpoint to send mail.

    Screenshot 2024-12-11 091941

    If you need to send emails programmatically, Graph SDKs is recommended.

    Hope this helps.

    If the answer is helpful, please click Accept Answer and kindly upvote it. If you have any further questions about this answer, please click Comment.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.