Closed ogarshol75 closed 3 years ago
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @armleads-azure.
Service team, please help to look into this question.
We are facing a similar issue with all our AzResourceGroup deployments. Something with the serialization seems to be broken:
Error Message:
##[error]7:59:14 AM - Error: Code=InvalidTemplate; Message=Deployment template validation failed: 'Template parameter JToken type is not valid. Expected 'String, Uri'. Actual 'Object'. Please see https://aka.ms/resource-manager-parameter-files for usage details.'.
This quote from version 2.5.0 of the Az.Resources module from yesterday seems a bit suspicious * Fixed serialization error for '-TemplateObject' and 'TemplateParameterObject' [#1528] [#6292]
Rolling back to 2.4.0 seems to have solved the issue for us.
we have started seeing similar issues with AZ 4.6.0.
As ogarshol75 said,
New-AzResourceGroupDeployment fails to serialize arrays of string from TemplateFile causing a breaking change
Arrays of objects works fine
E.g an array of a single element defined in parameter file as:
"ipConfigs": {
"value":
[
"10.xxx.xxx.100"
]
},
Gives the following input in deployment parameters:
ipConfigs Array [ [] ]
This occurred only with version Az 4.6.0 . If i revert to 4.5.0 it works fine. Please provide a fix.
Hi, thanks for reporting the bug. I've sent a PR to fix it.
We are facing a similar issue with all our AzResourceGroup deployments. Something with the serialization seems to be broken:
Error Message:
##[error]7:59:14 AM - Error: Code=InvalidTemplate; Message=Deployment template validation failed: 'Template parameter JToken type is not valid. Expected 'String, Uri'. Actual 'Object'. Please see https://aka.ms/resource-manager-parameter-files for usage details.'.
This quote from version 2.5.0 of the Az.Resources module from yesterday seems a bit suspicious
* Fixed serialization error for '-TemplateObject' and 'TemplateParameterObject' [#1528] [#6292]
Rolling back to 2.4.0 seems to have solved the issue for us.
I have this same problem when trying to use @OptionalParameters to pass in the _artifactsLocation and _artifactsLocationSaSToken - I get the same error, and digging into Azure Activity logs, I see more detail that is pointing at the _artifactsLocationSasToken -> It seems as though it is expecting a string/uri and receiving an object... to me it seems like it should expect an object, since the value is being passed in as a securestring, instead of a string.
I rolled back to 3.0.0 and it seems to work. I haven't gone through the exercise of testing different versions up to 4.6.1, but cloud shell broke with the 4.6.1 rollout, and I've seen others who freshly install the az module at current version (4.6.1) and it breaks there. I built a fresh windows10 vm and installed AZ modules at 3.0.0 and it worked, upgraded to 4.6.1 and it broke.
Same situation here. 4.6.0 messed up iteration through array parameters.
The issue is fixed in Az 4.7.0.
Description
New-AzResourceGroupDeployment fails to serialize arrays of string from TemplateFile causing a breaking change Arrays of objects works fine E.g an array of a single element defined in parameter file as: "dataDiskSizes": { "value": [ 63 ] }, Gives the folling input in deployment parameters: [[]]
This occurred once version 4.6.0 was released in both Windows and Ubunto dev-ops agents and after updating Az module to latest on Windows 10 machine
Steps to reproduce
Environment data
Module versions
Debug output
Error output