Skip to content

Inferred metrics

Kamil Mrzygłód edited this page Feb 8, 2024 · 14 revisions

Azure Cost Estimator will automatically infer some metrics based on the provided resources configuration. Those additional calculation may be related to expected usage, free tiers for resources or implicit metrics which are not directly defined. See below for detailed information.

Automation Account

When Automation Account is used in your template, ACE will automatically substract free tier from the final calculation. As for now, substracted metrics are:

  • 500 minutes of Basic Runtime
  • 744 hours for Watchers

If you want to adjust those values, use usage patterns for Automation Account.

Log Analytics

While Log Analytics supports Microsoft_OperationalInsights_workspaces_Paug_Data_Ingestion usage pattern in ACE, you can achieve more granular usage calculation if you leverage dailyQuotaGb parameter:

resource la 'Microsoft.OperationalInsights/workspaces@2022-10-01' = {
  name: 'infer-la-cost'
  location: rgLocation
  properties: {
    sku: {
      name: 'PerGB2018'
    }
    workspaceCapping: {
      dailyQuotaGb: 5
    }
  }
}

If dailyQuotaGb is defined, it overrides any value defined by Microsoft_OperationalInsights_workspaces_Paug_Data_Ingestion pattern.

Azure Container Registry

As Microsoft_ContainerRegistry_registries_Task_vCPU_Duration first 100 minutes are free, when usage pattern for this metric is used, it'll incorporate the free tier. Thus anytime you define custom value for Microsoft_ContainerRegistry_registries_Task_vCPU_Duration, ACE will report no cost for it until you define more than 100 minutes of its use.

Azure Kubernetes Service

When AKS is defined in your template, ACE will calculate its cost based not only on the AKS SKU selected, but also infer cost based on the agent pools. For example - let's assume you're creating a small AKS cluster based on Standard_DS3_v2 VMs. The result calculation will include cost of such an agent pool:

[Create] aks-priv
   \--- Type: Microsoft.ContainerService/managedClusters
   \--- Location: EU West
   \--- Total cost: 595.68 USD
   \--- Delta: +595.68 USD

Aggregated metrics:

-> DS3 v2 [595.6800000000001 USD]

Used metrics:

-> DS3 v2 | Virtual Machines DSv2 Series | DS3 v2 | 0.272 for 1 Hour

ACE will also automatically infer OS disk type depending on your cluster configuration. If you define multiple agent pools or several agents, disk cost will be multiplied by the number of machines.

 [Create] aksaceinferosdisk
   \--- Type: Microsoft.ContainerService/managedClusters
   \--- Location: EU West
   \--- Total cost: 327.84 USD
   \--- Delta: +327.84 USD

Aggregated metrics:

-> P10 LRS Disk [65.03999999999999 USD]
-> D2s v3 [262.79999999999995 USD]

Used metrics:

-> P10 LRS | Premium SSD Managed Disks | P10 LRS Disk | 21.68 for 1/Month
-> D2s v3 | Virtual Machines DSv3 Series | D2s v3 | 0.12 for 1 Hour

Since version 1.4, ACE will additionally infer Ultra SSD disk usage if configured in your template:

[Create] aks-20240106090729
   \--- Type: Microsoft.ContainerService/managedClusters
   \--- Location: EU West
   \--- Total cost: 162.22 USD
   \--- Delta: +162.22 USD

Aggregated metrics:

-> D2s v3 [154.76 USD]
-> Ultra LRS Reservation per vCPU Provisioned [0 USD]
-> Ultra LRS Provisioned Throughput (MBps) [0.41756000000000004 USD]
-> Ultra LRS Provisioned Capacity [0.62196 USD]
-> Ultra LRS Provisioned IOPS [6.4239999999999995 USD]

Used metrics:

-> D2s v3 | Virtual Machines DSv3 Series Windows | D2s v3 | 0.212 for 1 Hour
-> Ultra LRS | Ultra Disks | Ultra LRS Reservation per vCPU Provisioned | 0.0078 for 1/Hour
-> Ultra LRS | Ultra Disks | Ultra LRS Provisioned Throughput (MBps) | 0.000572 for 1/Hour
-> Ultra LRS | Ultra Disks | Ultra LRS Provisioned Capacity | 0.000213 for 1 GiB/Hour
-> Ultra LRS | Ultra Disks | Ultra LRS Provisioned IOPS | 8.8E-05 for 1/Hour

Currently ACE infers automatically only the disk size - configurable Throughput and IOPS will be possible to customize in the next versions of the toolset via usage patterns.

Azure Virtual Network

If you define virtualNetworkPeerings property when configuring Virtual Network, ACE will try to infer cost by checking how many peerings are actually defined. As peerings are charged based on a set of specific parameters (inbound / outbound transfer, inter / intra region, zone of a region), you may need to use Microsoft_Network_virtualNetworks_Inbound_data_transfer and Microsoft_Network_virtualNetworks_Outbound_data_transfer usage patterns to adjust estimation.

Since 1.4 version, ACE calculates prices for network peerings based on virtual networks' location. This means, that you will see different prices for each GB (inbound and outbound) depending on a region (Zone1 / Zone2 / Zone3).

Diagnostic Settings

When you define Microsoft.Insights/diagnosticSettings resources in your template, ACE will try to infer cost based on one the following fields:

  • workspaceId
  • storageAccountId
  • eventHubName

If those are defined, ACE will calculate basic cost with the following assumptions:

  • Storage Account used for Diagnostic Settings is created as StorageV2 account with Standard_LRS tier and replication
  • Event Hub Namespace used for collecting logs is deployed with Basic tier

As estimation is performed using artificial resource (i.e. ACE is not querying existing resources), inferring metrics for them is not supported. However, you can still use usage patterns for refining calculation.

Note that usage patterns defined in your template will be automatically applied for inferred Diagnostic Settings cost as artificial resources still generate correct metrics.

Azure Virtual Machine

When defining priority parameter of your virtual machine, ACE will infer its cost if value of that parameter differs from Regular. This applies to Low Priority / Spot VMs, which are calculated differently than "standard" machines.

ACE will also infer OS disk type and size depending on default Azure values. Inferring OS disk works only if disk is not defined in the template - otherwise, all the configuration is based on defined values instead. This is applicable for Availability Sets and VMSS as well.

Azure SQL Database

ACE will infer cost of a log of a database if you use Microsoft_Sql_servers_databases_vCore_Storage usage pattern. If the usage pattern is not provided, log size calculation isn't performed, as ACE cannot determine size of your database.