Skip to content

Bug with "Parameter Types Should Be Consistent" test #738

Closed
@edwardsp

Description

I am naming a resource using a property of an object passed as an input parameter to an ARM template and it is causing the 'Parameter Types Should Be Consistent' test to fail.

mainTemplate.bicep

targetScope = 'resourceGroup'

param input object

module module1 './mymodule.bicep' = {
  name: input.module_one // setting to 'moduleOne' works correctly
  params: {
    intext: 'hello'
  }
}

module module2 './mymodule.bicep' = {
  name: 'moduleTwo'
  params: {
    intext: module1.outputs.outtext
  }
}

mymodule.bicep

targetScope = 'resourceGroup'

param intext string

output outtext string = intext

This is the output from arm-ttk:

  Parameter Types Should Be Consistent                                                                    
    [-] Parameter Types Should Be Consistent (65 ms)                                                      
        Type Mismatch: Parameter 'intext' in nested template 'moduleTwo' is defined as string, but the pa 
rent template defines it as object). Line: 81, Column: 14                                                 
                                                                Parameter Types Should Be Consistent                                                                    
    [-] Parameter Types Should Be Consistent (65 ms)                                                      
        Type Mismatch: Parameter 'intext' in nested template 'moduleTwo' is defined as string, but the pa 
rent template defines it as object). Line: 81, Column: 14                                                 

Setting the name as a string will fix this. But, in my case I am actually setting a resourceGroup name based on an json input.

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions