createUIDefinition.json - arm-ttk reports unexpected error in "Outputs Must Be Present In Template Parameters"

Tim James 46 Reputation points
2022-03-08T09:13:23.677+00:00

Running the arm-ttk against a CreateUIDefinition.json and getting the following:-

Test-AzTemplate -TemplatePath /d/home/dug/timjam/azure/arm/testingpassed -Test Outputs-Must-Be-Present-In-Template-Parameters

Validating testingpassed\createUiDefinition.json
CreateUIDefinition
[-] Outputs Must Be Present In Template Parameters (22 ms)
A parameter cannot be found that matches parameter name 'ErrorId'.
A parameter cannot be found that matches parameter name 'ErrorId'.
A parameter cannot be found that matches parameter name 'ErrorId'.

I don't have a parameter ErrorId in either my CreateUiDefinition or MainTemplate and I don't believe it is mandatory, so I am unsure why this is reported as an error.

Azure Managed Applications
Azure Managed Applications
An Azure service that enables managed service providers, independent software vendors, and enterprise IT teams to deliver turnkey solutions through the Azure Marketplace or service catalog.
114 questions
{count} votes

Accepted answer
  1. tbgangav-MSFT 10,391 Reputation points
    2022-04-04T04:53:00.82+00:00

    Hi @Tim James ,

    <<Adding the summary as answer for the benefit of broader community members who might be looking for similar information>>

    Summary:

    Firstly, it was a bug to have the error description as "A parameter cannot be found that matches parameter name 'ErrorId'." which was fixed here to give more meaningful error description as "output <PARAMETER> does not return the expected type <TYPE>"

    Secondly, to ensure the outputs of the CUID are of type int in this case, wrapping each of the outputs with int() worked fine, and now the template test toolkit is all green as well. :)

    0 comments No comments

0 additional answers

Sort by: Most helpful