Wanted to demo Azure Runbook with daily PowerShell PS1 that send SharePoint storage report email with HTML table and CSV attachment. Features include:
- Hosted on Azure Platform-As-A-Service (PAAS)
- Read source data SharePoint Online (SAAS)
- SMTP for routing email with Exchange online
- Credential storage in Azure Automation secure string
- Logging with full debug
- Local execution with Visual Studio code to debug
Demo covers the creation of local PowerShell PS1 and execute to confirm functionality. Script reads Tenant Site Collection from SharePoint Online leveraging Client App ID and App Secret. Table of collected data is formatted with HTML and CSS then routed out with SMTP.