Issue: "Microsoft.ApiManagement/service/portalsettings" not working.
Is the "Microsoft.ApiManagement/service/portalsettings" working as expected?
I am unable to audit any of the Aliases under this type. Also using the rest api "portalsettings" returns a 404 error.
I'm not familiar with that resource provider, but you might be getting 404 because portal settings have never been created on the service in question. If that's the case, then you won't have portal settings fail compliance, because policies on portal settings won't generally be applicable if the resource doesn't exist.
If you have a policy question, please include the policy you are having trouble with and we can try to help you debug it.
I have several API Management resources created. One certainly has the delegation.url field set with a value. Both of them audit with the same reason for non-compliance in the "view compliance details" window:
Reason for non-compliance
No related resources match the effect details in the policy definition.
EXISTENCE CONDITION
Type
Microsoft.ApiManagement/service/portalsettings
Here is the PolicyRule:
"policyRule": {
"if": {
"allOf": [
{
"field": "type",
"equals": "Microsoft.ApiManagement/service"
}
]
},
"then": {
"effect": "[parameters('effect')]",
"details": {
"type": "Microsoft.ApiManagement/service/portalsettings",
"existenceCondition": {
"field": "Microsoft.ApiManagement/service/portalsettings/delegation.url",
"equals": "www.Skittles.com/delegationUrl"
}
}
}
}
Please let me know what you find.
@mylameaccount, thank-you for opening this issue. I've investigated this and determined that due to nonstandard behavior of the Microsoft.ApiManagement resource provider, the policy compliance functionality does not work on this resource type. We will be working with that team to try and get it fixed, but in the meantime, I've unpublished the aliases so others don't waste time trying to use them. We will add them back when the resource provider is working correctly with policy. Really sorry for the inconvenience here: we will do everything we can to enable your scenario.
Details on this and other problematic resource types can be found in a new Known Issues section of the readme: https://github.com/Azure/azure-policy#known-issues.
Closing this issue per changes to the support model for this repo. See the Getting Support section in the readme for details and Azure Policy support information.
This issue has been fixed. See known issues in the readme for details.