Prerequisites¶
Requirements for deploying the Scope Drift Monitor.
Licensing¶
| Requirement | Purpose |
|---|---|
| Power Platform Premium | Power Automate detection flows |
| Dataverse capacity | Scope and violation storage |
| Microsoft 365 E5 or E5 Compliance | Unified Audit Log access |
Permissions¶
Microsoft Entra ID Roles¶
| Role | Required For |
|---|---|
| Purview Compliance Admin | Audit log queries |
Power Platform Roles¶
| Role | Required For |
|---|---|
| Power Platform Admin | Configure production environment auditing and enable SAS Logging in Purview |
| System Administrator | Dataverse table creation and application-user role assignment |
Office 365 Management API Permissions¶
| Permission | Type | Purpose |
|---|---|---|
ActivityFeed.Read |
Application | Office 365 Management API audit log access |
Note: The active collector authenticates against
https://manage.office.com(Office 365 Management API), not Microsoft Graph. Microsoft Graph/security/auditLog/queriesis v1.0 for Purview Audit Search, but this solution uses the Office 365 Management API until a future migration is validated. GrantActivityFeed.Readadmin consent to the managed identity or app registration used by the scripts.
Power Platform activity logging in Purview¶
For each production environment monitored by Scope Drift Monitor:
- Configure Dataverse auditing for the environment and required tables/columns.
- Turn on Enable SAS Logging in Purview in Power Platform admin center > environment settings > Privacy and Security.
- Allow
https://*.api.powerplatformusercontent.comin network controls before enabling SAS Logging in Purview. - Assign Microsoft Purview Audit Logs or View-Only Audit Logs permissions to reviewers.
Power Platform admin activity collection is enabled by default, but user activity logs for production environments require the environment-level configuration above.
Authentication model¶
Use managed identity for Azure-hosted production automation:
- Enable a system-assigned managed identity on the Azure Automation account, Function, VM, or container host running the scripts.
- For shared automation, configure a user-assigned managed identity and set
AZURE_MANAGED_IDENTITY_CLIENT_ID. - Grant the identity Office 365 Management API
ActivityFeed.Readapplication permission and the required Dataverse application-user security role. - Use
AZURE_CLIENT_SECRETonly for local development fallback; rotate and remove it before production deployment.
Microsoft Graph Permissions (only for Test-AlertDelivery email path)¶
| Permission | Type | Purpose |
|---|---|---|
Mail.Send |
Delegated | Required by Test-AlertDelivery.ps1 to send email alerts via Send-MgUserMail. Not used by the production drift scanner. |
Note:
Test-AlertDelivery.ps1performs an interactiveConnect-MgGraph -Scopes Mail.Sendif no Graph context is present. Pre-authenticate with the same scope when running unattended. TheFrommailbox owner must be the signed-in user (delegated) or, if you adapt the script to application permissions, the app must holdMail.Send(Application) scoped via an exchange ApplicationAccessPolicy.
Identity Setup¶
- Configure a managed identity for production script hosts, or register an application for local development fallback.
- Grant required API permissions and admin consent.
- Create a Dataverse application user for the identity or app and assign the least-privilege role needed to read scope records and create violations.
- If a client secret is used for development, store it securely and remove it from production runbooks.
Security Note:
fsi_SDM_ClientSecretandAZURE_CLIENT_SECRETare legacy dev-only fallback paths. If a temporary secret is unavoidable, back it with Azure Key Vault, restrict access, and remove it before production. Without Key Vault backing, secret environment-variable values are accessible to Dataverse System Administrators. See Environment variable types for configuration guidance.
Validation Checklist¶
- E5 or E5 Compliance license available
- Power Platform Premium for flow creator
- Dataverse environment ready
- Managed identity configured for production script host
- Admin consent granted
- Audit logging enabled in tenant
- Dataverse auditing and Enable SAS Logging in Purview configured for each monitored production environment
Scope Drift Monitor v1.2.2