Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
alex-frankel opened this issue Jun 8, 2020 · 9 comments
Open
Labels
enhancement New feature or request reference function Noise caused by unevaluated reference function in an expression

Comments

@alex-frankel
Copy link
Contributor

alex-frankel commented Jun 8, 2020

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
Copy link
Contributor Author

#79

@alex-frankel
Copy link
Contributor Author

#25

@alex-frankel
Copy link
Contributor Author

#54

@alex-frankel alex-frankel added reference function Noise caused by unevaluated reference function in an expression enhancement New feature or request labels Jun 11, 2020
@alex-frankel
Copy link
Contributor Author

#72

@odegroot
Copy link

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

@spoelstraethan
Copy link

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
Copy link

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

@erikrose100
Copy link

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?

@K4pper
Copy link

K4pper commented Dec 11, 2024

Would love to hear an update on this as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request reference function Noise caused by unevaluated reference function in an expression
Projects
None yet
Development

No branches or pull requests

6 participants