-
-
Notifications
You must be signed in to change notification settings - Fork 16
Configuring usage patterns
Available from: 1.0
To achieve better accurracy with estimations, you can leverage usage patterns feature. If usage pattern is specified for a resource type, ACE will use provided value for calculating monthly cost. Usage patterns are defined as metadata object for both ARM Templates and Azure Bicep:
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.12.40.16777",
"templateHash": "8060235446393778821"
},
"aceUsagePatterns": {
"Microsoft_ContainerRegistry_registries_Registry_Unit": "15",
"Microsoft_ContainerRegistry_registries_Data_Stored": "50",
"Microsoft_ContainerRegistry_registries_Task_vCPU_Duration": "3600"
}
},
"resources": [
{
"type": "Microsoft.ContainerRegistry/registries",
"apiVersion": "2021-09-01",
"name": "metadataacr",
"location": "[resourceGroup().location]",
"sku": {
"name": "Basic"
}
}
]
}
metadata aceUsagePatterns = {
Microsoft_ContainerRegistry_registries_Registry_Unit: '15'
Microsoft_ContainerRegistry_registries_Data_Stored: '50'
Microsoft_ContainerRegistry_registries_Task_vCPU_Duration: '3600'
}
resource acr 'Microsoft.ContainerRegistry/registries@2021-09-01' = {
name: 'metadataacr'
location: resourceGroup().location
sku: {
name: 'Basic'
}
}
Metadataobject in Azure Bicep was introduced quite recently - make sure you've updated Bicep CLI / Azure CLI to get support for it.
Below table shows currently implemented support for usage patterns. Resources not listed are considered TBD:
| Service | Metric | Data type | Availability |
|---|---|---|---|
| ACR | Microsoft_ContainerRegistry_registries_Registry_Unit | Days | 1.0 |
| ACR | Microsoft_ContainerRegistry_registries_Data_Stored | GB | 1.0 |
| ACR | Microsoft_ContainerRegistry_registries_Task_vCPU_Duration | Second | 1.0 |
| Log Analytics | Microsoft_OperationalInsights_workspaces_Paug_Data_Ingestion | GB | > 1.0 |
Note, that usage patterns are applied for all resources of given type. For example, if you use Microsoft_ContainerRegistry_registries_Task_vCPU_Duration metric, its value will be applied to all Azure Container Registries defined within your template. This behavior will probably change in the future releases.
If you search for additional details, check below sections for advanced use.