Sending email from Azure Automation using Microsoft Graph

Bombbe 1,441 Reputation points
2023-01-09T08:51:33.247+00:00

Sending emails using the SmtpClient isn’t recommended anymore and Exchange Online deprecated basic authentication so I'm thinking to send emails using Microsoft Graph. I saw a lot of examples how to send emails using Microsoft Graph but all have same issue: Everyone is creating app registration and selecting Application permissions with Mail.Send permission.

This means that if someone got access to that automation he or she could basically send emails on behalf of every mailbox/user in our organization and this doesn’t sound like the perfect plan from a security perspective.

So what are my options here without compromising security?

Azure Automation
Azure Automation
An Azure service that is used to automate, configure, and install updates across hybrid environments.
1,366 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Bhanu Kiran 3,616 Reputation points
    2023-01-09T09:19:30.957+00:00

    Hi @Bombbe ,

    Application access policy will help you in this scenario. Please refer to this documentation for more details https://learn.microsoft.com/en-us/graph/auth-limit-mailbox-access .

    Hope this helps.

    If the answer is helpful, please click Accept Answer and kindly upvote. 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.