Loading...

How to Troubleshoot Deny Policy Step by Step

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.

zoeylan_0-1672113098276.png

 

 

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.

zoeylan_1-1672113137555.png

 

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.

zoeylan_2-1672113162314.png

 

 

Besides, you can check similar information in the activity log.

zoeylan_3-1672113183785.png

Find the ‘deny’ Policy action and click in the failed sub record.

zoeylan_4-1672113206439.png

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.

zoeylan_5-1672113228319.png

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.

zoeylan_6-1672113249198.png

 

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.

zoeylan_7-1672113293593.png

You can check compliance status for a specific policy by either finding it on the “Compliance” page or accessing through policy assignment page.

zoeylan_8-1672113309800.png

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

zoeylan_9-1672113333553.png

  • Scroll down on the compliance details page.

zoeylan_10-1672113351395.png

 

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).

zoeylan_11-1672113375580.png

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 more
Need help with this product?

We 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.

Azure PaaS Blog articles
Azure PaaS Blog articles

Azure PaaS Blog articles

Share post:

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...

1 year ago

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...

1 year ago

[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...

1 year ago

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 ...

1 year ago

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 ...

1 year ago

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...

1 year ago

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...

1 year ago

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...

2 years ago

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...

2 years ago

[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...

2 years ago

Newsletter

Get the latest Dynamics 365 and Power Platform content in your inbox

A curated digest of community blogs, product news, videos, and podcasts — delivered without the noise.

Weekly updates Unsubscribe anytime Fresh community picks
We use your email only for the newsletter and you can unsubscribe at any time.
By subscribing, you agree to the privacy policy.