Skip to content

Home / Proof

Telemetry lab: scalability engineering

5,000 subscriptions in 5 batched calls, zero throttling

5,000Subscriptions queried in 5 batched Resource Graph calls (simulated estate)Simulated fixtures
25 secBrowser streaming parse of a 5-million-row .csv.gz export
60 / 60Live Azure Management Group API calls with 0 throttling errorsLive tenant test

Batch pacing: subscriptions per Resource Graph call

1000Call 11000Call 21000Call 31000Call 41000Call 5
Each call carries up to 1,000 subscription IDs with server-side KQL aggregation.
  • Status: Simulated estate plus live tenant pacing verification
  • Type: Scalability engineering proof

Most lightweight FinOps scripts work on one subscription and collapse on an enterprise estate, triggering 429 Too Many Requests lockouts or crashing browser tabs on multi-gigabyte exports. Trimline was engineered to scale across Enterprise Agreements without backend server cost.

The bottlenecks we solved

  • No per-subscription API loops. Trimline batches up to 1,000 subscription IDs per Azure Resource Graph POST with server-side KQL aggregation: 5,000 subscriptions in 5 requests, and 500 subscriptions with 100,500 resources in full simulated runs with zero failures.
  • Header-aware rate-limit pacing. The scanner reads Microsoft's x-ms-user-quota-remaining headers instead of blind retry sleeps. In a live multi-level Management Group test in our own tenant it completed 60 of 60 calls with zero throttling at $0 cost.
  • Native gzip streaming. .csv.gz exports stream through the browser's native decompression: a 2-million-row file in about 9 seconds and a 5-million-row file in about 25 seconds, with no unzipping on a laptop.

Honest scope disclosure. The 500-subscription and 5,000-subscription sweeps were validated against simulated Azure CLI fixtures alongside Microsoft's open-source EA and FOCUS sample datasets. Live Management Group traversal and quota pacing were verified against Microsoft's production API in our own tenant.

Raw source

The paging loop, verbatim from scan.sh.

Resource Graph queries page 1,000 rows at a time with a skip token.

scan.sh, Resource Graph paging

  local q2='Resources | where type =~ "microsoft.compute/virtualmachines"
| extend ps = tostring(properties.extended.instanceView.powerState.code)
| where ps =~ "PowerState/deallocated" | project id, name, type, resourceGroup, location, tags'
  page_all() {
    # Every page, 1,000 rows at a time (Resource Graph skip tokens).
    local query="$1" tok="" res
    while :; do
      if [ -n "$tok" ]; then
        res="$(az graph query -q "$query" --subscriptions "$s" --first 1000 --skip-token "$tok" -o json </dev/null)"
      else
        res="$(az graph query -q "$query" --subscriptions "$s" --first 1000 -o json </dev/null)"
      fi
      printf '%s\n' "$res"
      tok="$(printf '%s' "$res" | jq -r '.skip_token // .skipToken // empty')"
      [ -n "$tok" ] || break
    done