question

TimJames-7158 avatar image
0 Votes"
TimJames-7158 asked tbgangav-MSFT answered

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

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
· 8
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @TimJames-7158,

If you don't have a parameter ErrorId in either CreateUiDefinition or MainTemplate then it's a weird error.
I have tried to reproduce the issue in various ways (i.e., by giving wrong syntaxes like adding extra comma, removing double quotes, trying with linked templates related mainTemplate, etc.) but was not successful to reproduce the issue.

182076-image.png

I hope you are trying with the latest 0.3 version arm-ttk. If not, please use the latest version.

182141-image.png

Are you getting same or similar error if you run some other tests in the same template path as well?
Can you provide your MainTemplate and CreateUiDefinition for me to try to reproduce the issue in my environment?

0 Votes 0 ·
image.png (40.9 KiB)
image.png (19.7 KiB)

Thanks for checking into this for me. I am using 0.3.

I will attach the two json files here to see if you get the same. (Removed now to protect IP)

0 Votes 0 ·

Hi @TimJames-7158,

The 3 errors are because of adding below 3 highlighted lines under the outputs property. If I remove those 3 lines then it doesn't throw the errors.

184832-image.png

 "startIP": "[steps('clusterDetails1').startIP]",
 "nodeCount": "[steps('clusterDetails2').nodeSection.nodeCount]",
 "storagePoolSize": "[steps('clusterDetails2').storageSection.storagePoolSize]",

The 3 parameters startIP, nodeCount and storagePoolSize are int type so that might be the reason but I am still trying to figure out why outputs property doesn't allow to map these int parameters related elements from steps property. Will provide a comment as soon as I have an update.

1 Vote 1 ·
image.png (42.3 KiB)
Show more comments

1 Answer

tbgangav-MSFT avatar image
0 Votes"
tbgangav-MSFT answered

Hi @TimJames-7158,

<<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. :)

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.