This post walks through how to build a fully automated alerting solution using Azure Logic Apps that:
- Queries Log Analytics for FSLogix profile usage
- Detects users who are using more than 90% of their disk space (Configurable, by changing the KQL)
- Sends personalized email alerts prompting users to clean up space
Prerequisites
- Before you begin, ensure the following are in place:
- Logic App (Consumption type) deployed in Azure
- FSLogix logging into Log Analytics
- FSLogix profile logs ingested into Log Analytics (via
WVDCheckpoints
) - Workspace includes fields:
UserName
,VHDSizeOnDisk
,VHDFreeSpace
,MaxVHDSize
.
- FSLogix profile logs ingested into Log Analytics (via
- Office 365 connectors configured
- Office 365 or Shared Mailbox connector configured in Logic App

Step 1: Create a Logic App
- In Azure Portal, search Logic Apps and click + Add
- Choose Consumption type
- Set your resource group, region, and name
- Once created, open Logic App Designer
Step 2: Add Recurrence Trigger
- Trigger:
Recurrence
- Frequency:
Day
- Interval:
1
- Time Zone
- Time:
12:00 PM
(adjust as needed)

Step 3: Run Log Analytics Query
- Add action: Azure Monitor Logs → Run query and list results
- Set:
- Subscription, Resource Group, Resource Name, and Log Analytics Workspace
- Paste the KQL query in to Query. Adjust Query as needed
- Time range:
Set in query
This query extracts the latest profile status per user, calculates usage, and filters for users over 90% usage over last 60 days

WVDCheckpoints
| where (Name=="ProfileLoggedOff" or Name=="ODFCLoggedOff")
and (Source=="RDAgent" or Source=="FSLogix")
and TimeGenerated>ago(60d)
| extend ProfileType=iff(Name=="ProfileLoggedOff","Profile","ODFC")
| summarize arg_max(TimeGenerated, *) by UserName, ProfileType
| extend ["VHD Size On Disk"]=todouble(replace_string(replace_string(tostring(Parameters.VHDSizeOnDisk),",",""),".","")),
["VHD Free Space"]=todouble(replace_string(tostring(Parameters.VHDFreeSpace),",",".")),
["VHD Max Size"]=todouble(replace_string(tostring(Parameters.MaxVHDSize),",","."))
| where ["VHD Size On Disk"]!=""
| project UserName,TimeGenerated,ProfileType,
["VHD Size On Disk"],
["VHD Free Space"],
["VHD Max Size"],
Usage=100*(["VHD Max Size"]-["VHD Free Space"])/["VHD Max Size"]
| order by ["Usage"] desc
| where Usage > 90
Step 4: Add “For Each” Loop
Add Action For Each
- Add action: Control → For each
- Input:
@body('Run_query_and_list_results')?['value']

Inside the loop:
Add “Send Email (from Shared Mailbox)” Action:
- Mailbox:
E-mail Address
- To:
@items('For_each')?['UserName']
- Subject:
items('For_each')?['UserName']
Action Required: Your FSLogix Profile Is Running Low on Space - Body: Add message to user and if you want you can add information from the KQL query.

Save and then Run or wait for Reoccurring trigger to start the workflow..
Every day, Logic Apps:
- Checks all users with FSLogix profiles
- Calculates actual disk usage from VHD metrics
- Notifies users exceeding 90% usage
- Provides self-help steps to clean their profile before it becomes an issue
