๐ง Azure SQL Elastic Pool is underutilized - prod.logic.yaml๐ข
- Contextual name: ๐ง prod.logic.yaml๐ข
- ID:
/ce/ca/azure/sql-database/elastic-pool-underutilized/prod.logic.yaml - Tags:
- ๐ข Logic test success
- ๐ข Logic with extracts
- ๐ข Logic with test data
Usesโ
Test Results ๐ขโ
Generated at: 2026-02-07T12:03:06.861253712Z Open
| Result | Id | Condition Index | Condition Text | Runtime Error |
|---|---|---|---|---|
| ๐ข | test1 | โ๏ธ 99 | โ๏ธ isDisappeared(CA10__disappearanceTime__c) | โ๏ธ null |
| ๐ข | test2 | โ๏ธ 199 | โ๏ธ extract('CA10__state__c') != 'Ready' | โ๏ธ null |
| ๐ข | test3 | โ๏ธ 299 | โ๏ธ extract('CA10__creationDate__c').withinLastDays(30) | โ๏ธ null |
| ๐ข | test4 | โ๏ธ 399 | โ๏ธ extract('CA10__monitorCpuPercentAvg30Day__c').isEmpty() && extract('CA10__monitorStoragePercentAvg30Day__c').isEmpty() | โ๏ธ null |
| ๐ข | test5 | โ๏ธ 499 | โ๏ธ extract('CA10__monitorDtuConsumptionPercentAvg30Day__c').isNotEmpty() && extract('CA10__monitorDtuConsumptionPercentAvg30Day__c') < number(20.0) && extract('CA10__monitorStoragePercentAvg30Day__c') < number(10.0) | โ๏ธ null |
| ๐ข | test6 | โ๏ธ 599 | โ๏ธ extract('CA10__monitorDtuConsumptionPercentAvg30Day__c').isEmpty() && extract('CA10__monitorCpuPercentAvg30Day__c') < number(20.0) && extract('CA10__monitorStoragePercentAvg30Day__c') < number(10.0) | โ๏ธ null |
| ๐ข | test7 | โ๏ธ 600 | โ๏ธ otherwise | โ๏ธ null |
Generation Bundleโ
| File | MD5 | |
|---|---|---|
| Open | /ce/ca/azure/sql-database/elastic-pool-underutilized/policy.yaml | 575FB048E217330966E791F929E0EA34 |
| Open | /ce/ca/azure/sql-database/elastic-pool-underutilized/prod.logic.yaml | 95CD364EC81E44A35124AEBB67709F12 |
| Open | /ce/ca/azure/sql-database/elastic-pool-underutilized/test-data.json | 75D8166F30FDA6046CE4562DDFE4C3FF |
| Open | /types/CA10__CaAzureSqlElasticPool__c/object.extracts.yaml | 4361B7D3C8748BEE62ADA2B3F84B57E6 |
Available Commandsโ
repo-manager policies generate FULL /ce/ca/azure/sql-database/elastic-pool-underutilized/prod.logic.yaml
repo-manager policies generate DEBUG /ce/ca/azure/sql-database/elastic-pool-underutilized/prod.logic.yaml
repo-manager policies generate CAPTURE_TEST_DATA /ce/ca/azure/sql-database/elastic-pool-underutilized/prod.logic.yaml
repo-manager policies generate TESTS /ce/ca/azure/sql-database/elastic-pool-underutilized/prod.logic.yaml
# Execute tests
repo-manager policies test /ce/ca/azure/sql-database/elastic-pool-underutilized/prod.logic.yaml
Contentโ
---
inputType: "CA10__CaAzureSqlElasticPool__c"
importExtracts:
- file: "/types/CA10__CaAzureSqlElasticPool__c/object.extracts.yaml"
testData:
- file: 'test-data.json'
conditions:
- status: "INAPPLICABLE"
currentStateMessage: "The Elastic Pool is not ready."
check:
NOT_EQUAL:
left:
EXTRACT: "CA10__state__c"
right:
TEXT: "Ready"
- status: "INAPPLICABLE"
currentStateMessage: "The Elastic Pool was created in the last 30 days."
check:
IS_WITHIN_LAST_DAYS:
offsetDays: 30
arg:
EXTRACT: "CA10__creationDate__c"
- status: "UNDETERMINED"
currentStateMessage: "There is not enough data in the CMDB to identify if the Elastic Pool is underutilized."
check:
AND:
args:
- IS_EMPTY:
arg:
EXTRACT: "CA10__monitorCpuPercentAvg30Day__c"
- IS_EMPTY:
arg:
EXTRACT: "CA10__monitorStoragePercentAvg30Day__c"
- status: "INCOMPLIANT"
currentStateMessage: "The Elastic Pool DTU consumption is less than 20% and storage utilization is less than 10%."
remediationMessage: "Consider rightsizing the Elastic Pool."
check:
AND:
args:
- NOT_EMPTY:
arg:
EXTRACT: "CA10__monitorDtuConsumptionPercentAvg30Day__c"
- LESS_THAN:
left:
EXTRACT: "CA10__monitorDtuConsumptionPercentAvg30Day__c"
right:
NUMBER: 20.0
- LESS_THAN:
left:
EXTRACT: "CA10__monitorStoragePercentAvg30Day__c"
right:
NUMBER: 10.0
- status: "INCOMPLIANT"
currentStateMessage: "The Elastic Pool CPU is less than 20% and storage utilization is less than 10%."
remediationMessage: "Consider rightsizing the Elastic Pool."
check:
AND:
args:
- IS_EMPTY:
arg:
EXTRACT: "CA10__monitorDtuConsumptionPercentAvg30Day__c"
- LESS_THAN:
left:
EXTRACT: "CA10__monitorCpuPercentAvg30Day__c"
right:
NUMBER: 20.0
- LESS_THAN:
left:
EXTRACT: "CA10__monitorStoragePercentAvg30Day__c"
right:
NUMBER: 10.0
otherwise:
status: "COMPLIANT"
currentStateMessage: "The Elastic Pool is not underutilized."