Premium Connector License Audit
Power Automate for Admins identifies all flows using premium connectors, cross-references maker accounts against licensed users via Office 365 Users, and exports flagged unlicensed usage to Excel Online with an email report.
Provided as-is, without warranty of any kind. Review and test each pattern in a non-production environment before deploying it to live automations. See our Terms.
Overview
This governance flow performs a weekly automated audit of all cloud flows in the target Power Platform environment, identifying flows that use premium connectors and cross-referencing the flow owners via the Office 365 Users connector. Flagged flows are exported to an Excel workbook on SharePoint and a formatted HTML email report is sent to the admin team.
Use Case
Organizations with mixed licensing need visibility into which flows consume premium connectors (Dataverse, SQL Server, Azure Blob, Key Vault, HTTP, Dynamics 365, Salesforce, SAP). Without this audit, unlicensed premium usage can go undetected, risking compliance violations and unexpected license costs. This flow automates the detection and reporting cycle.
The flow is ideal for teams that:
- IT admins managing mixed Power Platform licensing models
- Governance teams that need recurring visibility into premium connector usage
- Compliance owners tracking unlicensed premium consumption across makers
- Center of Excellence (CoE) teams running periodic license audits
Flow Architecture
Recurrence
RecurrenceRuns weekly on Monday at 7:00 AM EST.
Initialize Variables (9 parallel)
Initialize variableBinds 6 environment variables (target environment, admin email, SharePoint site URL, Excel drive, Excel file path, Excel table name) plus 3 working variables (premium connector list, flagged HTML accumulator, flagged count).
List All Flows
ListFlowsInEnvironment_V2 (Power Automate Management)Retrieves all flows in the target environment using admin scope.
For Each Flow: check premium connectors
Apply to each + If conditionFor each flow returned, fetches the full definition, extracts connection references, identifies premium connectors via string intersection, and decides whether to flag it.
- Get Flow Details — GetFlow via Power Automate Management retrieves the full flow definition including connectionReferences.
- Extract Connection Refs — Compose stringifies the connectionReferences object.
- Extract Premium Connectors Found — Compose identifies premium connectors via string intersection against the known premium API name list.
- Get Flow Owner Profile — Office 365 Users UserProfile_V2 looks up the flow creator by userId.
- Compose Premium Connector Names — Maps API names to friendly display names (e.g. shared_sql to SQL Server).
- Add Row To Excel — Excel Online AddRowV2 writes a row with FlowName, FlowId, OwnerEmail, OwnerDisplayName, PremiumConnectors, LicenseStatus, and AuditDate.
Environment Variables
| Schema name | Type | Default | Description |
|---|---|---|---|
| flowlibs_TargetEnvironmentName | String | <your-tenant-id> | Environment ID to scan. Set to the GUID of the target Power Platform environment. |
| flowlibs_AdminNotificationEmail | String | admin@contoso.com | Recipient of the audit report email — typically an admin distribution list. |
| flowlibs_SharePointSiteURL | String | https://your-tenant.sharepoint.com | Root SharePoint site URL hosting the audit Excel workbook. |
| flowlibs_ROIExcelDrive | String | <configure> | Graph drive ID for the Shared Documents library. Get from GET /sites/{siteId}/drives. |
| flowlibs_PremiumAuditExcelFile | String | /Shared Documents/FlowLibs - Premium Connector Audit.xlsx | Path to the audit workbook inside the configured drive. |
| flowlibs_PremiumAuditExcelTable | String | PremiumAudit | Name of the Excel table that receives the audit rows. |
Connectors & Connections
| Connector | API name | Actions used |
|---|---|---|
| Power Automate Management | shared_flowmanagement | ListFlowsInEnvironment_V2 (List all flows in environment) GetFlow (Get flow details including connectionReferences) |
| Office 365 Users | shared_office365users | UserProfile_V2 (Look up flow owner profile by userId) |
| Excel Online (Business) | shared_excelonlinebusiness | AddRowV2 (Append a row to the audit table) |
| Office 365 Outlook | shared_office365 | SendEmailV2 (Send the formatted audit report email) |
Note — All connections are referenced as solution connection references; the flow is portable between environments as long as a connection is mapped at import time.
Customization Guide
Almost every realistic variant of this flow can be implemented by changing environment variable values. A few cases require small edits inside the flow definition — those are called out explicitly below.
- Import the solution
- Import the FlowLibs Premium Connector License Audit solution into your target Power Platform environment.
- Update environment variables
- Set flowlibs_TargetEnvironmentName to your environment ID, flowlibs_AdminNotificationEmail to your admin distribution list, flowlibs_SharePointSiteURL to your SharePoint root, flowlibs_ROIExcelDrive to your Graph drive ID (get from GET /sites/{siteId}/drives), flowlibs_PremiumAuditExcelFile to the path of your audit workbook, and flowlibs_PremiumAuditExcelTable to match your Excel table name.
- Create the audit Excel workbook
- On SharePoint, create an Excel workbook with columns FlowName, FlowId, OwnerEmail, OwnerDisplayName, PremiumConnectors, LicenseStatus, AuditDate and format them as a named table that matches flowlibs_PremiumAuditExcelTable.
- Authorize all four connections
- Authorize the Power Automate Management, Office 365 Users, Excel Online (Business), and Office 365 Outlook connections with an account that has tenant admin or Power Platform admin rights for the target environment.
- Customize the premium connector list
- Edit Init_varPremiumConnectorList to add or remove connector API names (for example shared_sql, shared_commondataserviceforapps, shared_azureblob, shared_keyvault, shared_http, shared_dynamicscrmonline, shared_salesforce, shared_sap) to match your organization's license model.
- Turn on the flow
- After authorizing connections and configuring environment variables, turn the flow on so the weekly recurrence trigger begins running.
Key Expressions
The flow is intentionally light on Power Fx / WDL gymnastics — the heaviest expressions are the branch-name concatenation and the approval outcome check. They are listed below in the order they appear in the flow.
EXPR.01Premium connector detection
Checks the stringified connectionReferences for known premium API names; combined via OR across the 8 premium connectors in varPremiumConnectorList.
EXPR.02Owner lookup with fallback
Handles both userId and objectId fields returned by the Flow Management API and falls back to 'unknown' if neither is present.
EXPR.03Friendly name mapping
Nested replace() calls convert raw API names to display-friendly connector names for the report.
EXPR.04Audit date stamp
Stamps each Excel row with the scan date.
EXPR.05Email subject with flagged count
Builds the email subject line including the number of flagged flows and the audit date.
Comments
Sign in to join the conversation.
Sign inNo comments yet. Be the first to share your experience with this flow.