Azure / Azure/Azure-DataFactory
PrePostDeploymentScript fails to parse triggers that contain double-quotes in their definition
- Lingua principale
- PowerShell
- Stelle
- 529
- Fork
- 623
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
I am using the microsoft/azure-data-factory-utilities npm package for CI/CD to my ADF. My triggers are used against pipelines that take parameters, and those parameter values contain double-quotes in them. When I run PrePostDeploymentScript.ps1, I get errors like this:
```
##[warning] Unable to compare 'MyTrigger' trigger payload, this is not a failure. You can post the issue to https://github.com/Azure/Azure-DataFactory/issues to check if this is user error or limitation.
##[warning] Conversion from JSON failed with error: After parsing a value an unexpected character was encountered: '. Path 'pipelines[0].parameters.Param1', line 12, position 32. from Line: 200
```
While these are warnings, the result is that these triggers get unnecessarily stopped and restarted because the script fails to compare them against the current definition.
For reference, my trigger looks like this:
```
{
"name": "MyTrigger",
"properties": {
"annotations": [],
"runtimeState": "Started",
"pipelines": [
{
"pipelineReference": {
"referenceName": "MyPipeline",
"type": "PipelineReference"
},
"parameters": {
"Param1": "\"MyStringValue\"",
"StartDate": "@concat('\"', formatDateTime(adddays(trigger().scheduledTime, -10), 'yyyy-MM-dd'), '\"')",
"EndDate": "@concat('\"', formatDateTime(adddays(trigger().scheduledTime, -3), 'yyyy-MM-dd'), '\"')"
}
}
],
"type": "ScheduleTrigger",
"typeProperties": {
"recurrence": {
"frequency": "Week",
"interval": 1,
"startTime": "2020-10-13T04:00:00Z",
"timeZone": "UTC",
"schedule": {
"weekDays": [
"Saturday"
]
}
}
}
}
}
```
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Inizia con PrePostDeploymentScript.ps1 e riproduci il confronto utilizzando il JSON del trigger mostrato, soprattutto per i parametri che contengono virgolette doppie con escape. Il lavoro è completato quando il payload del trigger viene analizzato correttamente, le definizioni equivalenti vengono confrontate senza avvisi e i trigger invariati non vengono arrestati e riavviati inutilmente.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- azure, powershell
- Ambito
- cloud, devops
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 45/100