I have a simple Azure Policy that should check if all API-management URL's are lowercase (Display Name and API Url Suffix), but violations still pass the check, so obviously the policy is incorrect.
I am new to writing my own Azure Policies... Does anyone have an idea what could be wrong?
"policyRule": {
"if": {
"allOf": [
{
"field": "type",
"equals": "Microsoft.ApiManagement/service/apis"
},
{
"anyOf": [
{
"field": "Microsoft.ApiManagement/service/apis/path",
"notEquals": "[toLower(string(field('Microsoft.ApiManagement/service/apis/path')))]"
},
{
"field": "Microsoft.ApiManagement/service/apis/displayName",
"notEquals": "[toLower(string(field('Microsoft.ApiManagement/service/apis/displayName')))]"
}
]
}
]
}
}
Here is the updated
Azure Policychecks whether the API management display name and URL are lowercase. If either the display name or the path is not lowercase, it is considered non-compliant otherwise, it is compliant.The display name is located within the properties of API management.
Azure Policy:
Compliance result