-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRunbookIntervalLogicApp
More file actions
100 lines (100 loc) · 3.86 KB
/
Copy pathRunbookIntervalLogicApp
File metadata and controls
100 lines (100 loc) · 3.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
{
"definition": {
"$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
"actions": {
"Condition": {
"actions": {},
"else": {
"actions": {
"Send_an_email_(V2)": {
"inputs": {
"body": {
"Body": "<p>@{body('Create_job')}</p>",
"Subject": "Runbook Failed",
"To": "support@domain.com"
},
"host": {
"connection": {
"name": "@parameters('$connections')['office365']['connectionId']"
}
},
"method": "post",
"path": "/v2/Mail"
},
"runAfter": {},
"type": "ApiConnection"
}
}
},
"expression": {
"and": [
{
"equals": [
"@body('Create_job')?['properties']?['status']",
"Completed"
]
}
]
},
"runAfter": {
"Create_job": [
"Succeeded"
]
},
"type": "If"
},
"Create_job": {
"inputs": {
"host": {
"connection": {
"name": "@parameters('$connections')['azureautomation']['connectionId']"
}
},
"method": "put",
"path": "/subscriptions/@{encodeURIComponent('XXXXX')}/resourceGroups/@{encodeURIComponent('Azure_PSrunner')}/providers/Microsoft.Automation/automationAccounts/@{encodeURIComponent('PSauto')}/jobs",
"queries": {
"runbookName": "runbooknamehere",
"wait": true,
"x-ms-api-version": "2015-10-31"
}
},
"runAfter": {},
"type": "ApiConnection"
}
},
"contentVersion": "1.0.0.0",
"outputs": {},
"parameters": {
"$connections": {
"defaultValue": {},
"type": "Object"
}
},
"triggers": {
"Recurrence": {
"recurrence": {
"frequency": "Minute",
"interval": 5,
"timeZone": "GMT Standard Time"
},
"type": "Recurrence"
}
}
},
"parameters": {
"$connections": {
"value": {
"azureautomation": {
"connectionId": "/subscriptions/XXXXX/resourceGroups/Azure_PSrunner/providers/Microsoft.Web/connections/azureautomation",
"connectionName": "azureautomation",
"id": "/subscriptions/XXXXX/providers/Microsoft.Web/locations/westeurope/managedApis/azureautomation"
},
"office365": {
"connectionId": "/subscriptions/XXXXX/resourceGroups/Azure_PSrunner/providers/Microsoft.Web/connections/office365",
"connectionName": "office365",
"id": "/subscriptions/XXXXX/providers/Microsoft.Web/locations/westeurope/managedApis/office365"
}
}
}
}
}