Infrastructure / Identity / Microsoft 365 / Microsoft Fabric

Least-Privilege Email Notifications from Microsoft Fabric with Exchange Application RBAC

A production integration enabling Microsoft Fabric workloads to send automated email through a dedicated Exchange Online shared mailbox without granting tenant-wide Microsoft Graph Mail.Send access.

Microsoft Fabric Microsoft Entra ID Exchange Online Exchange Hybrid Application RBAC Azure Key Vault Azure RBAC GitHub Actions OIDC PowerShell

The problem

A data engineering workload needed to send automated operational notifications from Microsoft Fabric using a controlled corporate email address.

The straightforward solution appeared to be granting an Entra application Microsoft Graph Mail.Send. But application-level Graph mail permissions can create a much broader authorization boundary than a workload actually requires.

The application only needed to send from one approved shared mailbox.

Goal: allow an unattended Fabric workload to send email from exactly one approved Exchange Online shared mailbox, without granting broad mail permissions or distributing application credentials to developers.

The environment introduced several real-world complications:

  • Exchange was hybrid.
  • Exchange recipients were still authoritative on-premises.
  • Fabric required secure runtime access to application credentials.
  • DEV and PROD needed independent workload identities.
  • The original implementation guidance contained ambiguous API permissions.

Architecture

The final architecture deliberately separates the identity running the Fabric workload from the application identity Exchange authorizes to send email.

MICROSOFT FABRIC EMAIL NOTIFICATION ARCHITECTURE SECURE • LEAST-PRIVILEGE • PRODUCTION-ORIENTED Microsoft Fabric (PROD) Notebooks / Pipelines / Workloads PROD Workload Identity Service Principal Key Vault Secrets User Azure Key Vault Tenant ID Client ID Client Secret Sender Address Email Application Identity Service Principal Dedicated identity for mail authentication Exchange Application RBAC E Application Mail.Send Mailbox-specific scope SECURITY BOUNDARY Fabric identity can read notification secrets but has no Exchange mail authorization. The email application can send mail, but only through a mailbox-scoped Exchange RBAC assignment. NO TENANT-WIDE GRAPH MAIL.SEND

The key design decision: two identities, two jobs

The most important design choice was separating who runs the Fabric workload from which identity Exchange authorizes to send mail.

LEAST-PRIVILEGE AUTHORIZATION BOUNDARY SEPARATE IDENTITIES • SEPARATE PERMISSIONS • EXPLICIT BOUNDARIES FABRIC EXECUTION IDENTITY PROD Fabric Service Principal Dedicated production workload identity Key Vault Secrets User Read-only access to application secrets ✓ Read secrets only No Exchange Online Mail.Send authorization EMAIL APPLICATION IDENTITY Notification Application Dedicated Entra service principal Exchange Application Mail.Send Restricted with a custom management scope ✓ Approved mailbox InScope = True ✕ Other mailbox InScope = False Each identity receives only the permissions required for its job.

What I actually did

  1. Reviewed the proposed third-party architecture and challenged a broad permission assumption. I separated Microsoft Graph Mail.Send from Exchange Online Application Mail.Send and worked through the implementation requirements until it was confirmed that the additional Microsoft Graph application permissions were unnecessary for this deployment.
  2. Mapped the existing hybrid Exchange model before changing anything. I queried existing RemoteMailbox and RemoteSharedMailbox objects, identified the established shared-mailbox AD location, and confirmed that new Exchange Online mailboxes should originate through the hybrid recipient-management path.
  3. Provisioned and validated the notification mailbox. I created a RemoteSharedMailbox, synchronized the object through Entra Connect, verified the resulting Exchange Online SharedMailbox, and reconciled the Exchange GUID between the cloud and on-premises objects.
  4. Built the application identity and Exchange authorization layer. I created a dedicated Entra application/service principal, registered its service-principal reference in Exchange Online, and built a resource scope tied to the mailbox's ExternalDirectoryObjectId.
  5. Implemented mailbox-specific Exchange authorization. I assigned Application Mail.Send through the custom management scope instead of granting tenant-wide Microsoft Graph Mail.Send.
  6. Proved the authorization boundary. I tested the application against both the approved notification mailbox and an unrelated mailbox. The approved mailbox returned InScope = True; the unrelated mailbox returned InScope = False.
  7. Created a dedicated production secrets boundary. I provisioned a dedicated Azure Key Vault using Azure RBAC and stored the tenant ID, client ID, client secret, and sender address as independent secrets rather than distributing credentials through email or embedding them in code.
  8. Separated DEV and PROD workload identities. I reviewed the existing GitHub Actions / Fabric deployment architecture, documented the existing DEV OIDC trust, obtained approval for new production access, and introduced a dedicated PROD workload identity instead of extending the DEV service principal into Production.

Inspecting the hybrid Exchange model

The original implementation guidance assumed straightforward cloud mailbox creation. That was not appropriate for this environment because Exchange recipient attributes were still managed through the hybrid Exchange configuration.

I first enumerated existing remote shared mailboxes and inspected where the underlying directory objects were stored:

Get-RemoteMailbox -ResultSize Unlimited |
Where-Object {
    $_.RecipientTypeDetails -eq "RemoteSharedMailbox"
} |
Select-Object DisplayName,
              PrimarySmtpAddress,
              SamAccountName,
              DistinguishedName |
Format-Table -Auto
Why this mattered

Creating a cloud-only shared mailbox would have introduced an object that did not follow the organization's established source-of-authority model. Mapping the existing recipients first allowed the new mailbox to follow the same lifecycle and synchronization process.

Provisioning the Hybrid Shared Mailbox

The notification mailbox was created as a remote shared mailbox so the on-premises directory remained authoritative for the synchronized recipient.

New-RemoteMailbox `
    -Shared `
    -Name "Fabric Notifications" `
    -DisplayName "Fabric Notifications" `
    -Alias "fabric-notifications" `
    -SamAccountName "fabricnotify" `
    -UserPrincipalName "fabric-notifications@example.com" `
    -PrimarySmtpAddress "fabric-notifications@example.com" `
    -RemoteRoutingAddress "fabric-notifications@tenant.mail.onmicrosoft.com" `
    -OnPremisesOrganizationalUnit "OU=Shared_Mailboxes,OU=Resource_Accounts,DC=example,DC=local"

After synchronization, I validated the object from Exchange Online:

Get-Mailbox -Identity "fabric-notifications@example.com" |
Format-List DisplayName,
            RecipientTypeDetails,
            PrimarySmtpAddress,
            ExternalDirectoryObjectId,
            ExchangeGuid

The cloud mailbox was verified as a SharedMailbox, and its actual Exchange GUID was then aligned with the on-premises RemoteSharedMailbox representation.

Registering the notification application with Exchange

The Entra application and Exchange Online authorization are intentionally separate layers. After creating the Entra application, I registered the corresponding service principal reference in Exchange Online:

$AppId = "<application-client-id>"
$ServicePrincipalObjectId = "<service-principal-object-id>"

New-ServicePrincipal `
    -AppId $AppId `
    -ObjectId $ServicePrincipalObjectId `
    -DisplayName "fabric-notifications"

The Exchange object acts as the reference used by Exchange Application RBAC.

Scoping access to exactly one mailbox

The authorization scope was constructed from the mailbox's ExternalDirectoryObjectId rather than from the SMTP address.

$Sender = "fabric-notifications@example.com"

$Mailbox = Get-Mailbox -Identity $Sender

$MailboxObjectId =
    [guid]$Mailbox.ExternalDirectoryObjectId

$Filter =
    "ExternalDirectoryObjectId -eq '$MailboxObjectId'"

Get-Recipient `
    -Filter $Filter `
    -ResultSize Unlimited |
Format-Table PrimarySmtpAddress,
             RecipientTypeDetails,
             ExternalDirectoryObjectId

Only after confirming that the filter returned exactly one mailbox did I create the Exchange management scope:

New-ManagementScope `
    -Name "fabric-notifications-scope" `
    -RecipientRestrictionFilter $Filter
Security boundary

The scope follows the actual mailbox object. An SMTP-address change does not silently move authorization to another mailbox.

Assigning Application Mail.Send

The application received Exchange's Application Mail.Send role through the custom resource scope.

New-ManagementRoleAssignment `
    -Name "fabric-notifications-mailsend" `
    -Role "Application Mail.Send" `
    -App $ServicePrincipalObjectId `
    -CustomResourceScope "fabric-notifications-scope"
Important distinction: Exchange Application Mail.Send is not the same as assigning Microsoft Graph Mail.Send as an application permission. The latter was intentionally not granted.

Proving the authorization boundary

I did not treat successful object creation as proof that least privilege was working. The final Exchange authorization was tested against both an intended and unintended resource.

Positive authorization test

Test-ServicePrincipalAuthorization `
    -Identity $ServicePrincipalObjectId `
    -Resource "fabric-notifications@example.com" |
Format-Table RoleName,
             GrantedPermissions,
             AllowedResourceScope,
             InScope
RoleName              GrantedPermissions  AllowedResourceScope       InScope
--------              ------------------  --------------------       -------
Application Mail.Send Mail.Send           fabric-notifications-scope True

Negative authorization test

The same application was tested against an unrelated mailbox.

Test-ServicePrincipalAuthorization `
    -Identity $ServicePrincipalObjectId `
    -Resource "unrelated-user@example.com" |
Format-Table RoleName,
             GrantedPermissions,
             AllowedResourceScope,
             InScope
RoleName              GrantedPermissions  AllowedResourceScope       InScope
--------              ------------------  --------------------       -------
Application Mail.Send Mail.Send           fabric-notifications-scope False
Authorization result Approved notification mailbox: InScope = True
Unrelated mailbox: InScope = False

Protecting notification credentials with Azure Key Vault

Application credentials were intentionally kept out of tickets, email, source code, and Fabric notebooks.

I created a dedicated production Key Vault using Azure RBAC and stored only the configuration required by the notification workload:

graph-tenant-id
graph-client-id
graph-client-secret
graph-sender-address

The production Fabric workload identity receives Key Vault Secrets User at the vault scope. Administrative secret-management access remains a separate role.

Administrator Key Vault Secrets Officer
PROD Fabric Identity Key Vault Secrets User

DEV / PROD workload identity separation

The existing Fabric deployment model used GitHub Actions workload identity federation for DEV. Rather than extending the same service principal into Production, I recommended creating a separate PROD identity with independently governed access.

DEV / PROD WORKLOAD IDENTITY SEPARATION SAME DEPLOYMENT PIPELINE • SEPARATE IDENTITIES • ENVIRONMENT-SCOPED ACCESS GitHub Actions OIDC Organization / Repository / Environment DEV ENVIRONMENT Environment: dev GitHub environment-scoped OIDC trust DEV Service Principal sp-fabric-deploy-dev DEV Fabric workspaces only PROD ENVIRONMENT Environment: prd GitHub environment-scoped OIDC trust Dedicated PROD SP sp-fabric-deploy-prd PROD workspaces only Key Vault Secrets User read-only Separate identities • independent access • cleaner audit boundary

GitHub OIDC without stored Azure credentials

The Fabric deployment path uses GitHub Actions OIDC workload identity federation rather than storing a long-lived Entra client secret in GitHub.

GitHub Actions
    |
    | OIDC token
    v
Microsoft Entra ID
    |
    | Federated Identity Credential
    v
Environment-Specific Service Principal
    |
    v
Fabric Workspace

This gives the deployment pipeline a short-lived, environment-scoped identity while keeping the notification application's own credential isolated inside Azure Key Vault.

Security posture

No tenant-wide Graph Mail.Send Mail authorization is implemented through Exchange Application RBAC and restricted to one shared mailbox.
No human mailbox credentials Application and workload identities replace employee credentials for unattended processes.
Dedicated production secrets store Application credentials are retrieved from Azure Key Vault rather than embedded in source code or distributed through email.
Read-only runtime access The PROD Fabric identity receives Key Vault Secrets User rather than secret-management privileges.
DEV / PROD identity separation Production access is not added to the existing DEV service principal.
Authorization tested both ways The approved mailbox returns InScope=True while an unrelated mailbox returns InScope=False.

Notable issues along the way

Hybrid source of authority

The initial cloud-focused implementation guidance did not account for the existing hybrid Exchange model. I inspected existing recipients first and determined that the notification mailbox needed to originate as a RemoteSharedMailbox.

Mail.Send did not mean Mail.Send

Microsoft Graph Mail.Send and Exchange Application Mail.Send are different authorization mechanisms. Separating those concepts prevented an unnecessarily broad Graph application permission from being granted.

Requested Graph permissions were unnecessary

The early implementation guidance included directory-reading API permissions. Further technical review established that those permissions were required only when the deployment pipeline creates Fabric workspaces. This deployment uses existing workspaces, so the permissions were omitted.

DEV identity was not treated as a PROD identity

Reusing the existing DEV deployment service principal would have crossed an environment boundary. I recommended and implemented a dedicated Production workload identity with independently governed access.

Validation

Hybrid shared mailbox Validated
Exchange Online provisioning Validated
Notification service principal Validated
Mailbox-specific management scope Validated against one recipient
Positive authorization test InScope = True
Negative authorization test InScope = False
Azure Key Vault Configured
Production Key Vault RBAC Key Vault Secrets User assigned
End-to-end Fabric delivery Successfully validated in Production

Current result

Infrastructure ready for application validation The Microsoft 365, Exchange Online, Entra ID, and Azure Key Vault portions of the production notification architecture have been implemented and independently validated. The production Fabric identity can retrieve the notification configuration, while Exchange Online restricts mail authorization to the designated shared mailbox.

What this project demonstrates

Hybrid Exchange Architecture Microsoft Entra Workload Identities Exchange Application RBAC Azure Key Vault Azure RBAC Microsoft Fabric GitHub Actions OIDC DEV / PROD Isolation Least-Privilege IAM PowerShell Production Change Control Third-Party Architecture Review

Key takeaway

Least privilege is not just reducing a list of permissions. It means defining which identity can perform which action, against which resource, from which environment, and then testing that the boundary actually behaves as designed.
Previous
Previous

Deploying Azure Key Vault with Terraform

Next
Next

Secure Cloud SFTP Integration & Host Key Rotation Readiness (Azure Blob Storage)