azure-policy icon indicating copy to clipboard operation
azure-policy copied to clipboard

Feature request: Consider using EvaluationDelay:AfterProvisioningSuccess for Built in private DNS policies

Open anwojcie opened this issue 2 years ago • 8 comments

Hi,

Currently:

All Built In policies to set the DNS config on private DNS e.g. https://github.com/Azure/azure-policy/blob/e8fff400e6eee3502c3f3b4e7ac8301870aeac3f/built-in-policies/policyDefinitions/Storage/StoragePrivateDnsZoneGroup_Blob.json https://github.com/Azure/azure-policy/blob/master/built-in-policies/policyDefinitions/App%20Service/AppService_PrivateZoneGroup_DINE.json would be greatly enhanced if we put the evaluationDelay to AfterProvisioningSuccess.

Since the evaluationDelay is 10 min by default, creating a private Endpoint demands Application Teams to wait for 10min before they can actually use them, respectively before the private IP is resolvable by DNS.

This is especially painful if the Application Team uses CI/CD pipelines. They currently need to build weird workarounds such as scripts in their pipeline, local provisioner (scripts) in tf or deployment scripts in Bicep only to wait for this default evaluationDelay to be reached.

Another issue arises if the creation of the private Endpoint needs more than 10min. For example on a busy day at lunchtime with a just created CosmosDB. Since this can take more than 10min (I've seen up to 12min) but the default 10min delay starts counting on private endpoint deployment, this would cause the PolicyDeployment failing with "Resource Not Ready".

Solution:

Both issues are easily resolved by setting "EvaluationDelay":"AfterProvisioningSuccess" within the deployment. e.g.

{
  "properties": {
    ...
    "policyRule": {
      ...
      "then": {
        ...
        "details": {
          ...
          "EvaluationDelay":"AfterProvisioningSuccess",
          "deployment": {
            ...
          }
        }
      }
    }
  }
}

anwojcie avatar Nov 09 '22 07:11 anwojcie

I see this has been dormant for a while - this would be hugely beneficial.

earldata avatar Aug 04 '23 15:08 earldata

just hit this myself +1 from me

fearofweapons avatar Jan 18 '24 11:01 fearofweapons

+1 it would make life a whole lot better, allowing the apply stages of to both deploy and use the deployed resources in the same run.

olebru avatar Jan 25 '24 10:01 olebru

+1 This, so much this. We need this for our CI/CD pipeline with terraform.

torgro avatar Jan 25 '24 10:01 torgro

+1 need this aswell!

sikksakk avatar Jan 25 '24 11:01 sikksakk

+1 any one? I need this as well.

Mtaddeo1010 avatar Jan 29 '24 15:01 Mtaddeo1010

+1 this would be very useful

matt-buchanan avatar Jan 30 '24 10:01 matt-buchanan

+1 need this

dewolfs avatar Mar 15 '24 11:03 dewolfs