英文:
How to configure Azure Logic Apps to Execute Azure Data Factory on specific date
问题
我对Azure逻辑应用非常陌生,但我听说Azure数据工厂无法处理复杂的调度任务。
因此,我创建了一个Azure逻辑应用服务,已经开始了,但我完全不知所措。
我正在尝试基于以下日期触发Azure数据工厂管道:
上个月底但一个月前,例如2023年04月30日。
我以为在ADF中创建一个触发器会很容易,但看起来我需要使用逻辑应用。
任何帮助都会受到欢迎。
英文:
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.
Any help most welcomed.
答案1
得分: 1
以下是已翻译的内容:
{
"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
英文:
{
"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
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论