An Azure service that is used to implement corporate governance and standards at scale for Azure resources.
Hi @moti jirata
It looks like your custom deny policy for enforcing a minimum TLS version on App Service is not actually firing, so you are still able to drop your minTlsVersion down to 1.0. Here are the most common reasons this happens and
what you can check or tweak:
- Policy target type / operation mismatch • Your “if” block is scoped to the resource type “Microsoft.Web/sites/config” but when you update TLS via the portal or CLI you’re often hitting “Microsoft.Web/sites/write” on the parent resource. • The policy never actually evaluates because it only watches the child‐resource type. → Try adding or changing your “if” to also catch calls against
type == 'Microsoft.Web/sites'and then inspect the nested property alias.
Property alias is incorrect • The built-in App Service TLS policy uses the alias Microsoft.Web/sites/config/minTlsVersion (no “web.” prefix) or the ARM path siteConfig.minTlsVersion. • If your policy is checking Microsoft.Web/sites/config/web.minTlsVersion, it won’t match. → Update your rule to use the correct alias:
"field": "Microsoft.Web/sites/config/minTlsVersion"
Enforcement delay or disabled assignment • New or updated policy assignments can take up to one hour before the deny effect kicks in. • Make sure your assignment’s Enforcement is set to Enabled and your effect is Deny. → In the Azure portal, go to Policy → Assignments → select your assignment → Properties.
Exemption or higher-priority policy • Check for any policy exemptions at the resource or resource-group level that might override your deny. → In the portal view your assignment, scroll to “Exemptions” and remove/reset as needed.
No policy evaluation errors in Activity Log • If your policy did trigger, you’d see a RequestDisallowedByPolicy with a 403 in the Activity Log. → Look under Azure Monitor → Activity Log, filter for “Failed” and your resource name.
What to try next
- Update your JSON rule to something like:
"if": {
"allOf": [
{
"anyOf": [
{
"field": "type",
"equals": "Microsoft.Web/sites/config"
},
{
"field": "type",
"equals": "Microsoft.Web/sites"
}
]
},
{
"field": "kind",
"notContains": "functionapp"
},
{
"anyOf": [
{
"field": "Microsoft.Web/sites/config/minTlsVersion",
"exists": false
},
{
"field": "Microsoft.Web/sites/config/minTlsVersion",
"less": "[parameters('minimalTlsVersion')]"
}
]
}
]
},
"then": {
"effect": "[parameters('effect')]"
}
- Wait ~1-hour after re-assignment and then try again.
- Verify there’s no exemption in place.
- Attempt the update again and watch for a 403 in the Activity Log.
Kindly review the following documents for your reference:
Please refer to the following documents
List of built-in policy definitions - Azure Policy | Microsoft Learn
Request disallowed by policy error - Azure Resource Manager | Microsoft Learn
If you find the answer helpful, please click "upvote" and accept it. This will help others in the community with similar questions easily find the solution.