Я развертываю Azure Триггер ADF с помощью PowerShell, все триггеры развертываются успешно, кроме одного. Я получаю следующую ошибку:
[ERROR] Set-AzureRmDataFactoryV2Trigger : HTTP Status Code: BadRequest
[ERROR] Error Code: BadRequest
[ERROR] Error Message: The document creation or update failed because of invalid
[ERROR] reference 'pipeline1'
[ERROR] Request Id: 895u9iuy-4j34-227f-63d3-948jd8djw86e
[ERROR] Timestamp (Utc):07/13/2020 16:52:28
[ERROR] At C:\Users\user1\source\repos\MyProject\PowerShell\Deploy-AdFTr
[ERROR] iggersWithDLS.ps1:290 char:21
[ERROR] + ... Set-AzureRmDataFactoryV2Trigger -ResourceGroupName $stora ...
[ERROR] + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[ERROR] + CategoryInfo : CloseError: (:) [Set-AzureRmDataFactoryV2Trigger
[ERROR] ], CloudException
[ERROR] + FullyQualifiedErrorId : Microsoft.Azure.Commands.DataFactoryV2.SetAzureD
[ERROR] ataFactoryTriggerCommand
[ERROR]
Мой код PowerShell ниже.
$isTriggerExist = Get-AzureRmDataFactoryV2Trigger -ResourceGroupName $storageAccountRG -DataFactoryName $dataFactoryName -TriggerName $triggerObject.Name -ErrorAction:SilentlyContinue
if($isTriggerExist -eq $null)
{
Set-AzureRmDataFactoryV2Trigger -ResourceGroupName $storageAccountRG -DataFactoryName $dataFactoryName -Name $triggerObject.Name -DefinitionFile $file -Force
if($runTimeState[$g] -eq "Started")
{
Start-AzureRmDataFactoryV2Trigger -ResourceGroupName $storageAccountRG -DataFactoryName $dataFactoryName -TriggerName $triggerObject.name -Force
}
}
Я использую код JSON триггера.
{
"name": "trg_pipline1",
"properties": {
"annotations": [],
"runtimeState": "Started",
"pipelines": [
{
"pipelineReference": {
"referenceName": "pipeline1",
"type": "PipelineReference"
}
}
],
"type": "ScheduleTrigger",
"typeProperties": {
"recurrence": {
"frequency": "week",
"interval": 1,
"startTime": "2019-10-10T00:00:00Z",
"endTime": "2022-12-14T01:00:00Z",
"timeZone": "UTC",
"schedule": {
"hours": [
11,
13,
15,
17,
19,
21,
23
],
"weekDays": [
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday"
]
}
}
}
}
}