Azure / arm-template-whatif

A repository to track issues related to what-if noise suppression
MIT License
90 stars 14 forks source link

evaluate the reference() function as part of what-if evaluation #83

Open alex-frankel opened 4 years ago

alex-frankel commented 4 years ago

Describe the noise

Today, what-if/preflight is not able to evaluate/compile the reference() function prior to doing the what-if comparison, which results in noise. On the PUT side, we show reference().someProperty and on the GET side we show the evaluated property (since it was evaluated to create the resource in the first place.

Will add incoming noise reports that relate to this to this thread

alex-frankel commented 4 years ago

79

alex-frankel commented 4 years ago

25

alex-frankel commented 4 years ago

54

alex-frankel commented 4 years ago

72

odegroot commented 3 years ago

This issue leads to large amounts of noise, so +1 from me.

spoelstraethan commented 2 years ago

This really needs fixed, it seems to be breaking when I reference a resource deployed in a different Bicep module from the same top level template.

What-If still depressing me even on a SIMPLE template.......

snippet showing the resources from the output of ​az deployment group validate --verbose​

    "validatedResources": [ 
      { 
        "id": "/subscriptions/xxxxxx/resourceGroups/xxxxxx/providers/Microsoft.Resources/deployments/20221012163428_storageAccount", 
        "resourceGroup": "xxxxxx" 
      }, 
      { 
        "id": "/subscriptions/xxxxxx/resourceGroups/xxxxxx/providers/Microsoft.Resources/deployments/20221012163428_keyVault", 
        "resourceGroup": "xxxxxx" 
      }, 
      { 
        "id": "/subscriptions/xxxxxx/resourceGroups/xxxxxx/providers/Microsoft.Storage/storageAccounts/xxxxxxsa", 
        "resourceGroup": "xxxxxx" 
      } 
    ]

​and the What-If output.......

Note: The result may contain false positive predictions (noise). 
You can help us improve the accuracy of the result by opening an issue here: https://aka.ms/WhatIfIssues 

Resource and property changes are indicated with this symbol: 
  + Create 

The deployment will update the following scope: 

Scope: /subscriptions/xxxxxx/resourceGroups/xxxxxx

  + Microsoft.Storage/storageAccounts/xxxxxxsa [2021-08-01] 

      apiVersion:                          "2021-08-01" 
      id:                                  "/subscriptions/xxxxxxresourceGroups/xxxxxx/providers/Microsoft.Storage/storageAccounts/xxxxxxsa" 
      kind:                                "StorageV2" 
      location:                            "eastus2" 
      name:                                "xxxxxxsa" 
      properties.accessTier:               "Hot" 
      properties.supportsHttpsTrafficOnly: true 
      sku.name:                            "Standard_LRS" 
      tags.ApplicationName:                "xxxxxx-AzureSharedInfrastructure" 
      type:                                "Microsoft.Storage/storageAccounts" 

Resource changes: 1 to create. 
aslan-im commented 6 months ago

any updates? Ticket is open more than 4 years...

erikrose100 commented 1 month ago

This bug is creating a lot of noise and uncertainty when attempting to alter deployed bicep code to use modules that utilize existing resources and their properties. Any updates on this, @alex-frankel?