gpt4 book ai didi

azure - 循环逻辑应用程序事件 ARM 模板自动化

转载 作者:行者123 更新时间:2023-12-03 02:42:01 26 4
gpt4 key购买 nike

我们正在开发 ARM 模板,用于使用 Azure 逻辑应用程序安排自定义工作流程,该模板的第一个事件为“重复”。此外,我们还使用 ARM 模板自动部署逻辑应用

使用参数进行循环的 ARM 模板的最佳方法是什么,因为它有很多频率,并且使用参数处理所有参数将会在 ARM 模板\参数中暴露太多参数或者还有什么其他选项可以处理这种情况

最佳答案

我处理这种情况的方法是通过使用允许值限制参数集合中允许的值来修复参数可以接受的值。重复触发器有四个配置项,分别是频率、间隔、开始时间和时区,可以使用臂模板参数输入值。以下是一个示例 ARM 模板,它部署具有重复触发器的逻辑应用。请注意参数,因为我已经锁定了允许的值。

{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"workflows_testla1_name": {
"defaultValue": "testla1",
"type": "string"
},
"param_recurrence_interval": {
"type":"int",
"defaultValue": 2,
"allowedValues": [
1,
2,
3,
4,
5,
6
]
},
"param_recurrence_frequency": {
"type": "string",
"defaultValue": "Minute",
"allowedValues": [
"Day",
"Hour",
"Minute",
"Month",
"Second",
"Week",
"Year"
]
},
"param_recurrence_startTime":{
"type": "string",
"allowedValues": [
"2020-03-14T00:00:00Z"
]
},
"param_recurrence_timeZone" : {
"type": "string",
"defaultValue": "Cen. Australia Standard Time",
"allowedValues": [
"Cen. Australia Standard Time"
]
}
},
"resources": [
{
"apiVersion": "2017-07-01",
"dependsOn": [],
"location": "australiaeast",
"name": "[parameters('workflows_testla1_name')]",
"properties": {
"definition": {
"$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
"contentVersion": "1.0.0.0",
"parameters": {},
"triggers": {
"Recurrence": {
"recurrence": {
"frequency": "[parameters('param_recurrence_frequency')]",
"interval": "[parameters('param_recurrence_interval')]",
"startTime": "[parameters('param_recurrence_startTime')]",
"timeZone": "[parameters('param_recurrence_timeZone')]"
},
"type": "Recurrence"
}
},
"outputs": {}
},
"parameters": {},
"state": "Enabled"
},
"scale": null,
"tags": {},
"type": "Microsoft.Logic/workflows"
}
],
"variables": {}}

附带的参数文件如下所示

{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"workflows_testla1_name": {
"value": "testla1"

},
"param_recurrence_interval": {
"value": 3
},
"param_recurrence_frequency": {
"value": "Hour"
},
"param_recurrence_startTime":{
"value": "2020-03-14T00:00:00Z"
},
"param_recurrence_timeZone" : {
"value": "Cen. Australia Standard Time"
}
}}

关于azure - 循环逻辑应用程序事件 ARM 模板自动化,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60657112/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com