Skip to content

Conditionally use a param, or Null the entire object if nothing set #1914

Discussion options

You must be logged in to vote

Using: https://docs.microsoft.com/en-us/azure/azure-resource-manager/templates/template-functions-any

I have found that the following works, but it would be nice to null the entire object from a level below if nothing is used.

resource vnet 'Microsoft.Network/virtualNetworks@2020-06-01' = {
    name                            : p_vnet.name
    location                        : resourceGroup().location
    properties                      : {
        addressSpace                : {
            addressPrefixes         : p_vnet.cidr
        }
        subnets                     : [for subitem in p_vnet.subnets: {
            name                    : subitem.name
            properties       …

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@brwilkinson
Comment options

@brwilkinson
Comment options

@fluffy-cakes
Comment options

@fluffy-cakes
Comment options

@brwilkinson
Comment options

Answer selected by brwilkinson
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
2 participants