Repository navigation
v1.0.0
Initial public release.
Features
dbo.usp_ReadMailboxSQLCLR stored procedure that reads messages from an Exchange Online / Office 365 mailbox directly from T-SQL via the Microsoft Graph API.- No third-party NuGet dependencies -- uses
HttpWebRequestdirectly, so only your own compiled assembly needs to be registered in SQL Server (via hash-basedsys.sp_add_trusted_assembly, no certificate signing orTRUSTWORTHYneeded). - Two auth modes:
- App-only (default) --
client_credentialsgrant via Tenant/Client/ClientSecret, scoped to one mailbox via an Exchange Online Application Access Policy. - Delegated password (ROPC), optional -- pass
@Passwordto authenticate as the mailbox itself instead. Documented with its MFA/Conditional Access caveats; app-only is the recommended default.
- App-only (default) --
Setup
See README.md for Azure AD app registration steps (both modes) and Deploy.sql for the SQL-side registration script and usage examples.
Requirements
- SQL Server 2017 CU12+ / 2019+ (for hash-based trusted-assembly registration)
- .NET Framework 4.7.2 targeting pack to build
Build it yourself: clone, dotnet build -c Release, then run Deploy.sql against your target database.