如何配置 Azure Logic Apps 以在特定日期执行 Azure Data Factory。

huangapple go评论62阅读模式
英文:

How to configure Azure Logic Apps to Execute Azure Data Factory on specific date

问题

我对Azure逻辑应用非常陌生,但我听说Azure数据工厂无法处理复杂的调度任务。

因此,我创建了一个Azure逻辑应用服务,已经开始了,但我完全不知所措。

我正在尝试基于以下日期触发Azure数据工厂管道:

上个月底但一个月前,例如2023年04月30日。

我以为在ADF中创建一个触发器会很容易,但看起来我需要使用逻辑应用。

如何配置 Azure Logic Apps 以在特定日期执行 Azure Data Factory。

任何帮助都会受到欢迎。

英文:

I am extremely new to Azure Logic Apps, but I've been told that Azure Data Factory is not capable handling complex scheduling.

Therefore, I have create an Azure Logic App service, I have made a start, but I am completely lost.

I am trying to trigger an Azure Data Factory pipeline based on the following date

Last Month End but one e.g.	30/04/2023

I thought this would be easy to create a Trigger for this in ADF, but it looks like I need to use Logic Apps.

如何配置 Azure Logic Apps 以在特定日期执行 Azure Data Factory。

Any help most welcomed.

答案1

得分: 1

以下是已翻译的内容:

The UX way I would go for:
如何配置 Azure Logic Apps 以在特定日期执行 Azure Data Factory。

{
"definition": {
"$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
"actions": {
"Condition": {
"actions": {},
"else": {
"actions": {
"show_last_month_date": {
"inputs": {
"name": "演示数值",
"value": "@{subtractFromTime(startOfMonth(addToTime(utcNow(),1,'month')),1,'day')}"
},
"runAfter": {},
"type": "SetVariable"
}
}
},
"expression": {
"and": [
{
"equals": [
"@variables('LHS')",
"@variables('RHS')"
]
}
]
},
"runAfter": {
"演示": [
"成功"
]
},
"type": "If"
},
"day_of_month": {
"inputs": {
"variables": [
{
"name": "LHS",
"type": "integer",
"value": "@int(dayOfMonth(utcNow()))"
}
]
},
"runAfter": {
"last_day_of_month": [
"成功"
]
},
"type": "InitializeVariable"
},
"演示": {
"inputs": {
"variables": [
{
"name": "演示数值",
"type": "string"
}
]
},
"runAfter": {
"day_of_month": [
"成功"
]
},
"type": "InitializeVariable"
},
"last_day_of_month": {
"inputs": {
"variables": [
{
"name": "RHS",
"type": "integer",
"value": "@int(formatDateTime(subtractFromTime(startOfMonth(addToTime(utcNow(),1,'month')),1,'day'),'dd'))"
}
]
},
"runAfter": {},
"type": "InitializeVariable"
}
},
"contentVersion": "1.0.0.0",
"outputs": {},
"parameters": {},
"triggers": {
"Recurrence_daily": {
"recurrence": {
"frequency": "Day",
"interval": 1,
"schedule": {
"hours": [
"1"
],
"minutes": [
10
]
},
"startTime": "2023-06-06T12:00:00Z",
"timeZone": "UTC"
},
"type": "recurrence"
}
}
},
"parameters": {}
}

The code wise way to achieve this:

  • The following example is available in MS shows how to update the
    trigger definition so that the trigger runs only once on the last day
    of each month:
"triggers": {
  "Recurrence": {
    "recurrence": {
      "frequency": "Month",
      "interval": 1,
      "schedule": {
        "monthDays": [-1]
      }
    },
    "type": "Recurrence"
  }
}

Take a look at the below as well:
https://github.com/MicrosoftDocs/azure-docs/issues/26707

英文:

The UX way I would go for:
如何配置 Azure Logic Apps 以在特定日期执行 Azure Data Factory。

{
"definition": {
    "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
    "actions": {
        "Condition": {
            "actions": {},
            "else": {
                "actions": {
                    "show_last_month_date": {
                        "inputs": {
                            "name": "demo value",
                            "value": "@{subtractFromTime(startOfMonth(addToTime(utcNow(),1,'month')),1,'day')}"
                        },
                        "runAfter": {},
                        "type": "SetVariable"
                    }
                }
            },
            "expression": {
                "and": [
                    {
                        "equals": [
                            "@variables('LHS')",
                            "@variables('RHS')"
                        ]
                    }
                ]
            },
            "runAfter": {
                "demo": [
                    "Succeeded"
                ]
            },
            "type": "If"
        },
        "day_of_month": {
            "inputs": {
                "variables": [
                    {
                        "name": "LHS",
                        "type": "integer",
                        "value": "@int(dayOfMonth(utcNow()))"
                    }
                ]
            },
            "runAfter": {
                "last_day_of_month": [
                    "Succeeded"
                ]
            },
            "type": "InitializeVariable"
        },
        "demo": {
            "inputs": {
                "variables": [
                    {
                        "name": "demo value",
                        "type": "string"
                    }
                ]
            },
            "runAfter": {
                "day_of_month": [
                    "Succeeded"
                ]
            },
            "type": "InitializeVariable"
        },
        "last_day_of_month": {
            "inputs": {
                "variables": [
                    {
                        "name": "RHS",
                        "type": "integer",
                        "value": "@int(formatDateTime(subtractFromTime(startOfMonth(addToTime(utcNow(),1,'month')),1,'day'),'dd'))"
                    }
                ]
            },
            "runAfter": {},
            "type": "InitializeVariable"
        }
    },
    "contentVersion": "1.0.0.0",
    "outputs": {},
    "parameters": {},
    "triggers": {
        "Recurrence_daily": {
            "recurrence": {
                "frequency": "Day",
                "interval": 1,
                "schedule": {
                    "hours": [
                        "1"
                    ],
                    "minutes": [
                        10
                    ]
                },
                "startTime": "2023-06-06T12:00:00Z",
                "timeZone": "UTC"
            },
            "type": "recurrence"
        }
    }
},
"parameters": {} }

The code wise wise way to achieve this:

  • The following example is available in MS shows how to update the
    trigger definition so that the trigger runs only once on the last day
    of each month:

     "triggers": {
     "Recurrence": {
         "recurrence": {
             "frequency": "Month",
             "interval": 1,
             "schedule": {
                 "monthDays": [-1]
             }
         },
         "type": "Recurrence"
     }
    

    }

Take a look at the below as well:
https://github.com/MicrosoftDocs/azure-docs/issues/26707

huangapple
  • 本文由 发表于 2023年6月5日 22:22:42
  • 转载请务必保留本文链接:https://go.coder-hub.com/76407405.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定