Contents
Introduction
This is my first blog post regarding the Azure space! On my blog today, I want to shed light on a common issue customers face: tracking the usage of Cores across their licenses. This is vital for understanding how many Cores are being utilized versus what’s available. Currently, Azure Portal lacks a direct report view for this, forcing customers to manually check each license and linked server to sum up the Core count, which is a hassle.
Good news, though. When a customer asks for such a report, there’s a simpler method: querying the Azure Resource Graph (ARG). The query I’ve got does the heavy lifting. It counts the Cores from each linked Arc machine, adjusts the count to meet the minimum requirements (8 vCores per VM and 16 pCores per physical server), and then presents this data alongside the license info.
This approach is a game-changer. It not only saves time but also gives a more accurate picture of Core usage.
Steps to Gather Data
Open Resource Graph Explorer
Within the Azure Portal open Resource Graph Explorer.
Kusto Query (KQL)
resources
| where type =~ "microsoft.hybridcompute/licenses"
| extend sku = tostring(properties.licenseDetails.edition)
| extend totalCores = tostring(properties.licenseDetails.processors)
| extend coreType = case(
properties.licenseDetails.type =~ 'vCore','Virtual core',
properties.licenseDetails.type =~ 'pCore','Physical core',
'Unknown'
)
| extend status = tostring(properties.licenseDetails.state)
| extend licenseId = tolower(tostring(id)) // Depending on what is stored in license profile, might have to get the immutableId instead
| join kind=inner(
resources
| where type =~ "microsoft.hybridcompute/machines/licenseProfiles"
| extend machineId = tolower(tostring(trim_end(@"\/\w+\/(\w|\.)+", id)))
| extend licenseId = tolower(tostring(properties.esuProfile.assignedLicense))
) on licenseId // Get count of license profile per license, a license profile is created for each machine that is assigned a license
| join kind=inner(
resources
| where type =~ "microsoft.hybridcompute/machines"
| extend machineId = tolower(id)
| extend coreCount = toint(properties.detectedProperties.coreCount)
) on machineId // Get core count by machine
| extend adjustedCoreCount = iff(sku =~ "Standard"
, case(coreCount < 8, 8, coreCount) ,
iff(sku =~ "DataCenter"
, case(coreCount < 16, 16, coreCount)
,coreCount))
| extend machineName = tostring(split(machineId, "/")[-1])
| project machineName, machineId, licenseId, name, type, location, subscriptionId, resourceGroup, sku, totalCores, coreType, status, adjustedCoreCount
| summarize UsedCoreCount = sum(adjustedCoreCount) by licenseId, name, type, location, subscriptionId, resourceGroup, sku, totalCores, coreType, status
Share on: