π§ Azure API Management service in a capacity-based tier has no active APIs - prod.logic.yamlπ’
- Contextual name: π§ prod.logic.yamlπ’
- ID:
/ce/ca/azure/api-management/no-active-apis/prod.logic.yaml - Tags:
- π’ Logic test success
- π’ Logic with extracts
- π’ Logic with test data
Usesβ
- π Azure API Management Service
- π Azure API Management Service - object.extracts.yaml
- π§ͺ test-data.json
Test Results π’β
Generated at: 2026-09-22T15:06:28.816580441Z Open
| Result | Id | Condition Index | Condition Text | Runtime Error |
|---|---|---|---|---|
| π’ | gone | βοΈ 99 | βοΈ isDisappeared(CA10Z1__disappearanceTime__c) | βοΈ null |
| π’ | missing-provisioning-state | βοΈ 199 | βοΈ extract('CA10Z1__provisioningState__c').isEmpty() | βοΈ null |
| π’ | updating | βοΈ 299 | βοΈ extract('CA10Z1__provisioningState__c') != 'Succeeded' | βοΈ null |
| π’ | missing-sku | βοΈ 399 | βοΈ extract('CA10Z1__skuName__c').isEmpty() | βοΈ null |
| π’ | consumption | βοΈ 499 | βοΈ extract('CA10Z1__skuName__c') == 'Consumption' | βοΈ null |
| π’ | missing-created-at | βοΈ 599 | βοΈ extract('CA10Z1__createdAtUtc__c').isEmpty() | βοΈ null |
| π’ | age-boundary | βοΈ 699 | βοΈ extract('CA10Z1__createdAtUtc__c').withinLastDays(30) | βοΈ null |
| π’ | empty | βοΈ 799 | βοΈ CA10Z1__Azure_API_Management_APIs__r.hasNo(COMPLIANT) | βοΈ null |
| π’ | only-disappeared-api | βοΈ 799 | βοΈ CA10Z1__Azure_API_Management_APIs__r.hasNo(COMPLIANT) | βοΈ null |
| π’ | active-api | βοΈ 800 | βοΈ otherwise | βοΈ null |
Generation Bundleβ
| File | MD5 | |
|---|---|---|
| Open | /ce/ca/azure/api-management/no-active-apis/policy.yaml | F761C7BDB922D2714D3B629CA940D936 |
| Open | /ce/ca/azure/api-management/no-active-apis/prod.logic.yaml | D330ADFC70E92DE353DA8C70D4415FE3 |
| Open | /ce/ca/azure/api-management/no-active-apis/test-data.json | 1AA3D36758EB9D6BA37E1E378867D2C2 |
| Open | /types/CA10Z1__CaAzureApiManagementService__c/object.extracts.yaml | B952BD8DD43509E9EEA57E650ACDA9AD |
Available Commandsβ
repo-manager policies generate FULL /ce/ca/azure/api-management/no-active-apis/prod.logic.yaml
repo-manager policies generate DEBUG /ce/ca/azure/api-management/no-active-apis/prod.logic.yaml
repo-manager policies generate CAPTURE_TEST_DATA /ce/ca/azure/api-management/no-active-apis/prod.logic.yaml
repo-manager policies generate TESTS /ce/ca/azure/api-management/no-active-apis/prod.logic.yaml
# Execute tests
repo-manager policies test /ce/ca/azure/api-management/no-active-apis/prod.logic.yaml
Contentβ
---
inputType: "CA10Z1__CaAzureApiManagementService__c"
testData:
- file: "test-data.json"
importExtracts:
- file: "/types/CA10Z1__CaAzureApiManagementService__c/object.extracts.yaml"
conditions:
- status: "UNDETERMINED"
currentStateMessage: "Provisioning state is unavailable."
check:
IS_EMPTY:
arg:
EXTRACT: "CA10Z1__provisioningState__c"
- status: "INAPPLICABLE"
currentStateMessage: "The API Management service is not successfully provisioned."
check:
NOT_EQUAL:
left:
EXTRACT: "CA10Z1__provisioningState__c"
right:
TEXT: "Succeeded"
- status: "UNDETERMINED"
currentStateMessage: "SKU is unavailable."
check:
IS_EMPTY:
arg:
EXTRACT: "CA10Z1__skuName__c"
- status: "INAPPLICABLE"
currentStateMessage: "The API Management service uses the Consumption tier."
check:
IS_EQUAL:
left:
EXTRACT: "CA10Z1__skuName__c"
right:
TEXT: "Consumption"
- status: "UNDETERMINED"
currentStateMessage: "Creation time is unavailable."
check:
IS_EMPTY:
arg:
EXTRACT: "CA10Z1__createdAtUtc__c"
- status: "INAPPLICABLE"
currentStateMessage: "The API Management service is within its first 30 days."
check:
IS_WITHIN_LAST_DAYS:
offsetDays: 30
arg:
EXTRACT: "CA10Z1__createdAtUtc__c"
- status: "INCOMPLIANT"
currentStateMessage: "The non-Consumption API Management service has no active APIs."
remediationMessage: "Verify the API inventory in Azure, then remove the service if it is unused."
check:
RELATED_LIST_HAS_NO:
status: "COMPLIANT"
relationshipName: "CA10Z1__Azure_API_Management_APIs__r"
otherwise:
status: "COMPLIANT"
currentStateMessage: "The non-Consumption API Management service has at least one active API."
relatedLists:
- relationshipName: "CA10Z1__Azure_API_Management_APIs__r"
conditions: []
otherwise:
status: "COMPLIANT"
currentStateMessage: "This API record is active in Cloudaware CMDB."