Query Details

M365 E5 Benefit Usage

Query

// M365 E5 Benefit Usage - Daily Benefit Consumption
// M365 E5/A5/F5/G5 and E5/A5/F5/G5 Security customers get a data grant of up to 5 MB/user/day.
// Source: Operation table, OperationCategory == "Billing"
// Ref: https://azure.microsoft.com/en-us/pricing/offers/sentinel-microsoft-365-offer/
// =====================================================================

let Price = 3.0; // Sentinel + Log Analytics ingestion per GB
let LicensedUsers = 100; // <-- Set your M365 E5/A5/F5/G5 licensed user count
let GrantPerUserMB = 5;
let DailyGrantMB = LicensedUsers * GrantPerUserMB;
let DailyGrantGB = round(toreal(DailyGrantMB) / 1024.0, 4);
Operation
| where TimeGenerated > ago(30d)
| where OperationCategory == "Billing"
| where Detail has "Benefit amount used"
| extend 
    BenefitGB = todouble(extract(@"Benefit amount used:\s*([\d.]+)\s*GB", 1, Detail)),
    BenefitType = extract(@"Benefit type used:\s*(\S+)", 1, Detail)
| where isnotnull(BenefitGB)
| summarize 
    ClaimedBenefitGB = round(sum(BenefitGB), 6)
    by Day = bin(TimeGenerated, 1d)
| extend 
    ClaimedBenefitMB = round(ClaimedBenefitGB * 1024, 2),
    DailyGrantGB = DailyGrantGB,
    DailyGrantMB = toreal(DailyGrantMB)
| extend 
    GrantUsedPct = round(iff(DailyGrantGB > 0, ClaimedBenefitGB / DailyGrantGB * 100, 0.0), 1),
    OverGrantGB = round(iff(ClaimedBenefitGB > DailyGrantGB, ClaimedBenefitGB - DailyGrantGB, 0.0), 4),
    SavedCostUSD = round(ClaimedBenefitGB * Price, 2)
| project 
    Day, 
    ClaimedBenefitGB, ClaimedBenefitMB,
    DailyGrantGB, DailyGrantMB, GrantUsedPct, OverGrantGB,
    SavedCostUSD
| order by Day desc

Explanation

This query is designed to analyze the daily usage of a data benefit provided to Microsoft 365 E5/A5/F5/G5 and Security customers. Here's a simple breakdown of what the query does:

  1. Setup and Constants:

    • It sets the price for data ingestion at $3.00 per GB.
    • It assumes there are 100 licensed users.
    • Each user is granted 5 MB of data per day, which is calculated to a total daily grant in both MB and GB.
  2. Data Filtering:

    • The query looks at data from the last 30 days in the "Operation" table.
    • It filters for records related to billing where the detail includes "Benefit amount used."
  3. Data Extraction and Calculation:

    • It extracts the amount of benefit used in GB and the type of benefit from the details.
    • It calculates the total claimed benefit in GB for each day.
    • It converts this claimed benefit into MB for easier comparison.
  4. Comparison and Analysis:

    • It calculates the percentage of the daily grant that was used.
    • It determines if the claimed benefit exceeds the daily grant and calculates the excess.
    • It estimates the cost savings by multiplying the claimed benefit by the price per GB.
  5. Output:

    • The query outputs a table with the following columns for each day:
      • Date
      • Claimed benefit in GB and MB
      • Daily grant in GB and MB
      • Percentage of the grant used
      • Amount of benefit used over the grant in GB
      • Estimated cost savings in USD
  6. Ordering:

    • The results are ordered by date in descending order, showing the most recent data first.

This query helps organizations track their data benefit usage, identify any overages, and understand potential cost savings from the benefit.

Details

David Alonso profile picture

David Alonso

Released: April 8, 2026

Tables

Operation

Keywords

OperationBillingBenefitUsagePricingUsersDataGrantConsumption

Operators

letroundtorealagohasextendtodoubleextractisnotnullsummarizebiniffprojectorder by

Actions