[英]PowerShell Error while using the AzureRM Module - HTTP Status Code: NotFound
[英]Getting HTTP Status Code: BadRequest when creating Azure Data Factory Trigger using PowerShell with AzureRm module
我正在使用 PowerShell 部署 Azure ADF 觸發器,除一個觸發器外,所有觸發器都成功部署。 我收到以下錯誤
[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"
]
}
}
}
}
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.