How to Troubleshoot Deny Policy Step by Step
For security or compliance, your subscription administrators might assign policies that limit how resources are deployed. Deny policy, as one policy type, is used to prevent a resource request that does not match defined standards through a policy definition and fails the request. For example, deny policies that prevent creating public IP addresses, network security groups, user-defined routes, or route tables.
Document Reference: https://learn.microsoft.com/en-us/azure/governance/policy/concepts/effects#deny
This blog will show you how to troubleshoot deny policy related issues and how to fix them.
Troubleshoot RequestDisallowedByPolicy errors and non-compliant resources
[Example built-in policy]
Policy Definition Name: Storage accounts should have the specified minimum TLS version
Policy Definition ID: fe83a0eb-a853-422d-aac2-1bffd182c5d0
Scenario 1:
You tried to change the “Minimum TLS version” from “Version 1.2” to “Version 1.1”, but the operation failed.
By checking the error message in the Notifications panel, it’s clear that the update operation failed because it was blocked by a policy (policy id: fe83a0eb-a853-422d-aac2-1bffd182c5d0).
You can use the name of a policy assignment or policy definition to get more details about a policy that caused the error. Specifically, you can navigate to the policy page and find the policy definition and policy assignment based on the id shown in the error message.
By checking the “if” section in the policy definition and parameter values defined in the policy assignment, you can easily understand that the policy forces you to use the minimum TLS version ≥ 1.2. That’s why it does not allow you to change it to 1.1.
Besides, you can check similar information in the activity log.
Find the ‘deny’ Policy action and click in the failed sub record.
Double check the error code and make sure it’s “RequestDisallowedByPolicy”. Then, you can click the JSON to view more details of this failed operation. By searching “evaluationdetails”, you can navigate to the response body part.
By formatting the content, you can get a clear view like below, which helps you understand why the operation was blocked by the deny policy.
Solutions:
- You can keep the minimum TLS version unchanged (recommended in this example).
- Remove or disable the policy assignment (need to check with your policy admin).
- Create a policy exemption (need to check with your policy admin).
Scenario 2:
You want to figure out why some resources are shown as non-compliant on the “Compliance” page.
You can check compliance status for a specific policy by either finding it on the “Compliance” page or accessing through policy assignment page.
Please make sure you select the “Non-compliant” in the drop-down list to check the non-compliant resources.
- Click the “Details” to check the compliance details
- Scroll down on the compliance details page.
Under the “Compliance details”, there are one or more blocks for policy aliases defined in policy definition respectively. In this case shown above, the policy has to check the resource type (equals to storage account) and minimum TLS version. The first block checking the resource type shows that it’s compliant since the current value and target value matches. The second block checks minimum TLS version. The target value (defined in the policy assignment: 1.2) is different from the current value (the current storage account’s minimum TLS version allowed: 1.1).
By checking the configuration for this storage account, we can see that the current minimum TLS version value is 1.1. So, it’s expected that this storage account is shown as a non-compliant resource.
Solutions:
- Manually change the minimum TLS version to Version 1.2 from the Storage side.
- If you want to create a remediation task to manage non-compliant resources at once, you can change your policy effect from “deny” to “modify” if possible and then run a remediation task.
Published on:
Learn moreWe can help you with How to Troubleshoot Deny Policy Step by Step
If you want help implementing, troubleshooting, or improving this product, contact us and we’ll point you in the right direction.
Related posts
Azure Storage - TLS 1.0 and 1.1 retirement
Overview TLS 1.0 and 1.1 retirement on Azure Storage was previously announced for Nov 1st, 2024, and it was postponed recently to 1 year later...
Efficient Management of Append and Page Blobs Using Azure Storage Actions
Overview In Azure Storage, Blob Lifecycle Management (BLM) allows you to automate the management of your data based on rules defined by...
[Azure AI Search] Internal Server Error when creating CMK encrypted objects
Scenario Customers follow the Microsoft doc to create CMK encrypted objects (data source, index etc.), but get the 500 Internal Serv...
Optimizing Azure Table Storage: Automated Data Cleanup using a PowerShell script with Azure Automate
Scenario This blog’s aim is to manage Table Storage data efficiently. Imagine you have a large Azure Table Storage that accumulates logs from ...
Optimizing Azure Table Storage: Automated Data Clean-up using a PowerShell script with Azure Automat
Scenario This blog’s aim is to manage Table Storage data efficiently. Imagine you have a large Azure Table Storage that accumulates logs from ...
Restoring Soft-Deleted Blobs with multithreading in Azure Storage Using C#
Blob soft delete is an essential feature that safeguards your data against accidental deletions or overwrites. By retaining deleted data for a...
Performing simple Azure Table Storage REST API operations using curl command.
The blog provides guidance to perform simple Table Storage REST API operations such as Create table, Delete Table, Insert entity, Delete entit...
Bulk delete all the old jobs from the batch account
Deleting a Job also deletes all Tasks that are part of that Job, and all Job statistics. This also overrides the retention period for Task dat...
Utilizing Azure Storage and Runbooks for scheduled automated backups of Azure SQL Databases
In this article, we are going to provide detailed steps to create a scheduled Azure SQL Database backup to storage account using automation. T...
[Azure Service Bus] JMS messages getting dead-lettered
The article discusses a problem where numerous messages end up in the dead letter queue (DLQ) when the JMS service bus consumer connects to th...