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

AZ Deployment Group What-If -- Azure Bicep Output Not Produced For Modules with Dependencies #4361

Closed
AErmie opened this issue Sep 9, 2021 · 2 comments

Comments

@AErmie
Copy link

AErmie commented Sep 9, 2021

Describe the bug

When using az deployment group what-if with Azure Bicep templates that are called via modules, only modules without any dependencies actually produce/show their output (ie. what will be created). All other resources are not listed, giving the incorrect assumption that they will not be created.

Command Name
az deployment group what-if --resource-group GHES-aermie --template-file main.bicep

To Reproduce:

Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.

Sample Bicep code

module nsgModule './nsg.bicep' = {
  name: 'nsgDeploy'
  params: {
    accountPrefix: accountPrefix
    location: location
    tags: tags
  }
}

module vnetModule './vnet.bicep' = {
  name: 'vnetDeploy'
  params: {
    accountPrefix: accountPrefix
    location: location
    tags: tags
    addressPrefix: addressPrefix
    ghes_subnetPrefix: ghes_subnetPrefix
    runners_subnetPrefix: runners_subnetPrefix
    ghes_nsgID: nsgModule.outputs.networkSecurityGroup_ID_GHES
    runners_nsgID: nsgModule.outputs.networkSecurityGroup_ID_Runners
  }
}

output networkSecurityGroup_ID_GHES string = nsgModule.outputs.networkSecurityGroup_ID_GHES
output networkSecurityGroup_Name_GHES string = nsgModule.outputs.networkSecurityGroup_Name_GHES
output networkSecurityGroup_Location_GHES string = nsgModule.outputs.networkSecurityGroup_Location_GHES
output networkSecurityGroup_SecurityRules_GHES string = nsgModule.outputs.networkSecurityGroup_SecurityRules_GHES
output networkSecurityGroup_ID_Runners string = nsgModule.outputs.networkSecurityGroup_ID_Runners
output networkSecurityGroup_Name_Runners string = nsgModule.outputs.networkSecurityGroup_Name_Runners
output networkSecurityGroup_Location_Runners string = nsgModule.outputs.networkSecurityGroup_Location_Runners
output networkSecurityGroup_SecurityRules_Runners string = nsgModule.outputs.networkSecurityGroup_SecurityRules_Runners

output virtualNetwork_Name string = vnetModule.outputs.virtualNetwork_Name
output virtualNetwork_Location string = vnetModule.outputs.virtualNetwork_Location
output virtualNetwork_AddressPrefix string = vnetModule.outputs.virtualNetwork_AddressPrefix
output virtualNetwork_SubnetAddressPrefix_GHES string = vnetModule.outputs.virtualNetwork_SubnetAddressPrefix_GHES
output virtualNetwork_SubnetAddressPrefix_Runners string = vnetModule.outputs.virtualNetwork_SubnetAddressPrefix_Runners

Expected Behavior

From the above-listed Bicep example, output for both the NSG and VNET is expected, but only output for the NSG is produced.

Environment Summary

Windows-10-10.0.19041-SP0
Python 3.8.9
Installer: MSI

azure-cli 2.27.1

Extensions:
aks-preview 0.5.25
portal 0.1.2

Additional Context

It may be related to Issue #19308

@ghost ghost added the Needs: Triage 🔍 label Sep 9, 2021
@AErmie
Copy link
Author

AErmie commented Sep 9, 2021

Note: This issue was originally posted in the Azure-CLI repo: Azure/azure-cli#19309
@ishepherd

@alex-frankel
Copy link
Collaborator

This is a dup of Azure/arm-template-whatif#157. We are currently investigating with how best to solve the issue. cc @shenglol as FYI

@ghost ghost locked as resolved and limited conversation to collaborators May 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants