We use the node.js packages via YAML script to generate the ARM Templates for ADF deployment. Something has changed with the generation of the PrePostDeployment script which is what is used to start and stop the ADF triggers. The following lines have been added (noted by **). The Power Shell script does not understand what to do with the "?". I haven't changed anything. I don't know if the parameters have changed? If the package.json file needs to change? My YAML file and package.json items look like the sample in [https://learn.microsoft.com/en-us/azure/data-factory/continuous-integration-delivery-improvements (with the real values in YAML of course). Again this worked before the new year. I am hoping someone has seen this and can help. Thanks!
function Update-TriggerTemplate {
param(
[string]$templateJson,
[PSCustomObject]$templateParameters
)
$parameterMatches = [System.Text.RegularExpressions.Regex]::Matches($templateJson, '\[parameters\([^)]*\)\]')
foreach ($parameterMatch in $parameterMatches) {
$parameterName = $parameterMatch.Value.Substring(13, $parameterMatch.Value.Length - 16)
if ($null -ne $templateParameters.$($parameterName)) {
**$parameterType = $templateParameters.$($parameterName).value ? $templateParameters.$($parameterName).value.GetType().Name : $null
if ($parameterType -eq 'Object[]') {
$parameterValue = ConvertTo-Json $templateParameters.$($parameterName).value
$templateJson = $templateJson -replace [System.Text.RegularExpressions.Regex]::Escape("`"$($parameterMatch.Value)`""), $parameterValue
} elseif ($parameterType -eq 'Boolean' -or $parameterType -eq 'Int64') {
$templateJson = $templateJson -replace [System.Text.RegularExpressions.Regex]::Escape("`"$($parameterMatch.Value)`""), $templateParameters.$($parameterName).value
} else {**
$templateJson = $templateJson -replace [System.Text.RegularExpressions.Regex]::Escape($parameterMatch.Value), $templateParameters.$($parameterName).value
}
}
}
return $templateJson
}