π§ Azure SQL Managed Instance is underutilized - prod.logic.yamlπ’
- Contextual name: π§ prod.logic.yamlπ’
- ID:
/ce/ca/azure/sql-managed-instance/instance-underutilized/prod.logic.yaml - Tags:
- π’ Logic test success
- π’ Logic with extracts
- π’ Logic with test data
Usesβ
- π Azure SQL Managed Instance
- π Azure SQL Managed Instance - object.extracts.yaml
- π§ͺ test-data.json
Test Results π’β
Generated at: 2026-02-10T22:33:37.724182746Z Open
| Result | Id | Condition Index | Condition Text | Runtime Error |
|---|---|---|---|---|
| π’ | 001 | βοΈ 99 | βοΈ isDisappeared(CA10Z1__disappearanceTime__c) | βοΈ null |
| π’ | 002 | βοΈ 199 | βοΈ extract('CA10Z1__state__c') != 'Ready' | βοΈ null |
| π’ | 003 | βοΈ 299 | βοΈ extract('CA10Z1__monitorCpuPercentAvg30Day__c').isEmpty() || extract('CA10Z1__monitorIoWrittenMbAvg30Day__c').isEmpty() || extract('CA10Z1__monitorIoReadMbAvg30Day__c').isEmpty() | βοΈ null |
| π’ | 004 | βοΈ 399 | βοΈ extract('CA10Z1__monitorCpuPercentAvg30Day__c') < number(20.0) && extract('CA10Z1__monitorIoWrittenMbAvg30Day__c') < number(50.0) && extract('CA10Z1__monitorIoReadMbAvg30Day__c') < number(50.0) | βοΈ null |
| π’ | 005 | βοΈ 400 | βοΈ otherwise | βοΈ null |
Generation Bundleβ
| File | MD5 | |
|---|---|---|
| Open | /ce/ca/azure/sql-managed-instance/instance-underutilized/policy.yaml | 95DE7651211CAEFB5140C9EF32C5D671 |
| Open | /ce/ca/azure/sql-managed-instance/instance-underutilized/prod.logic.yaml | E0E25180B60EEC74E4833E7D0269E21D |
| Open | /ce/ca/azure/sql-managed-instance/instance-underutilized/test-data.json | 24A98AE982320883FAB55A919D887F01 |
| Open | /types/CA10Z1__CaAzureSqlManagedInstance__c/object.extracts.yaml | CEB619A9B852A33627260BC10279728E |
Available Commandsβ
repo-manager policies generate FULL /ce/ca/azure/sql-managed-instance/instance-underutilized/prod.logic.yaml
repo-manager policies generate DEBUG /ce/ca/azure/sql-managed-instance/instance-underutilized/prod.logic.yaml
repo-manager policies generate CAPTURE_TEST_DATA /ce/ca/azure/sql-managed-instance/instance-underutilized/prod.logic.yaml
repo-manager policies generate TESTS /ce/ca/azure/sql-managed-instance/instance-underutilized/prod.logic.yaml
# Execute tests
repo-manager policies test /ce/ca/azure/sql-managed-instance/instance-underutilized/prod.logic.yaml
Contentβ
---
inputType: "CA10Z1__CaAzureSqlManagedInstance__c"
importExtracts:
- file: "/types/CA10Z1__CaAzureSqlManagedInstance__c/object.extracts.yaml"
testData:
- file: 'test-data.json'
conditions:
- status: "INAPPLICABLE"
currentStateMessage: "The instance is not ready."
check:
NOT_EQUAL:
left:
EXTRACT: "CA10Z1__state__c"
right:
TEXT: "Ready"
- status: "UNDETERMINED"
currentStateMessage: "There is not enough data in the CMDB to identify if the instance is underutilized."
check:
OR:
args:
- IS_EMPTY:
arg:
EXTRACT: "CA10Z1__monitorCpuPercentAvg30Day__c"
- IS_EMPTY:
arg:
EXTRACT: "CA10Z1__monitorIoWrittenMbAvg30Day__c"
- IS_EMPTY:
arg:
EXTRACT: "CA10Z1__monitorIoReadMbAvg30Day__c"
- status: "INCOMPLIANT"
currentStateMessage: "The instance is underutilized with average CPU utilization < 20% and average disk read/write I/O < 50 MB."
remediationMessage: "Rightsize, consolidate, or terminate the instance."
check:
AND:
args:
- LESS_THAN:
left:
EXTRACT: "CA10Z1__monitorCpuPercentAvg30Day__c"
right:
NUMBER: 20.0
- LESS_THAN:
left:
EXTRACT: "CA10Z1__monitorIoWrittenMbAvg30Day__c"
right:
NUMBER: 50.0
- LESS_THAN:
left:
EXTRACT: "CA10Z1__monitorIoReadMbAvg30Day__c"
right:
NUMBER: 50.0
otherwise:
status: "COMPLIANT"
currentStateMessage: "The instance is not underutilized."