SMTP Microsoft OAuth Setup
Configure your notifications using Microsoft OAuth SMTP
Prerequisites
Microsoft 365 account (Office 365)
Admin access to Azure Portal
Admin access to Microsoft 365 Admin Center (for some settings)
Part 1: Create App Registration in Azure Portal
Create App Registration
In the left menu, click "App registrations"
Click "+ New registration"
Fill in the registration form:
Name:
Email SMTP Service
(or any name you prefer)Supported account types: Select "Accounts in this organizational directory only (Single tenant)"
Redirect URI: Leave blank (not needed for SMTP)
Click "Register"
Part 2: Create Client Secret
Generate Client Secret
In your app registration, go to "Certificates & secrets" in the left menu
Click the "Client secrets" tab
Click "+ New client secret"
Fill in the details:
Description:
SMTP Client Secret
(or any description)Expires: Choose expiration period (recommended: 24 months)
You'll need to create a new secret before it expires!
Click "Add"
Part 3: Configure API Permissions
Add SMTP Permissions
In your app registration, go to "API permissions" in the left menu
Click "+ Add a permission"
Select "APIs my organization uses"
Search for "Office 365 Exchange Online"
Click on "Office 365 Exchange Online"
Select "Application permissions" (NOT Delegated permissions)
Check the box for "SMTP.SendAsApp"
Click "Add permissions"
Part 4: Register Service Principal in Exchange Online
This is the most commonly missed step! You must register your Azure AD app as a Service Principal in Exchange Online.
Prepare PowerShell and Connect
Open PowerShell as Administrator
Install Exchange Online PowerShell module (if not installed):
Install-Module -Name ExchangeOnlineManagement
Connect to Exchange Online:
Connect-ExchangeOnline -UserPrincipalName [email protected]
Assign Mailbox Permissions
Option 1 — Assign FullAccess to a mailbox:
Add-MailboxPermission -Identity "[email protected]" -User <Your-Application-Client-ID> -AccessRights FullAccess
Option 2 — Grant organization-wide send permission (less secure):
New-ManagementRoleAssignment -Role "Application Mail.SendAsApp" -App <Your-Application-Client-ID>
Part 5: Verify Configuration
What You Need
Tenant ID (from Part 1)
Client ID (from Part 1)
Client Secret (from Part 2)
Sender Email: The mailbox that will send emails (e.g., [email protected])
SMTP Settings
SMTP Host:
smtp.office365.com
(Default)SMTP Port:
587
(Default)Security:
Auto
(Default)
Quick Test Checklist
PowerBI Portal Notifications Configuration

Enter these values acquired on the configuration process into the SMTP configuration UI by choosing the 'Office 365 - OAuth' on the 'SMTP Config' under the 'Notifications' tab -> 'Email Configuration'
Common Issues and Solutions
Last updated