-
Notifications
You must be signed in to change notification settings - Fork 4
/
arm-template.json
156 lines (154 loc) · 6.56 KB
/
arm-template.json
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"deploymentName": {
"type": "string",
"defaultValue": "[concat('sftpw', uniqueString(resourceGroup().id))]",
"metadata": {
"description": "A unique random base name for this service"
}
},
"FOLDERS_TO_WATCH": {
"type": "string",
"defaultValue": "",
"metadata": {
"description": "JSON, that defines folders to monitor. E.g. \"{'my-server.com/myfolder/*.*': {'user1': 'pwd1'}, 'my-other-server/*.xml': {'user2': 'pwd2'}}\" "
}
},
"POLLING_INTERVAL_CRON_EXP": {
"type": "string",
"defaultValue": "*/5 * * * * *",
"metadata": {
"description": "CRON expression, that defines the polling period"
}
},
"OUTPUT_QUEUE_OR_TOPIC_NAME": {
"type": "string",
"defaultValue": "sftp-change-notifications",
"metadata": {
"description": "Queue name to output events to. For Event Grid this should be the full custom topic URL."
}
},
"SERVICE_BUS_CONN_STRING": {
"type": "string",
"defaultValue": "",
"metadata": {
"description": "Azure Service Bus connection string. Specify it, if you wish events to be sent to a Service Bus queue/topic. Otherwise leave blank."
}
},
"EVENT_GRID_TOPIC_KEY": {
"type": "string",
"defaultValue": "",
"metadata": {
"description": "Azure Event Grid custom topic key. Specify it, if you wish events to be sent to an Event Grid custom topic.. Otherwise leave blank."
}
}
},
"variables": {
"storageAccountName": "[concat(parameters('deploymentName'), 'st')]",
"hostingPlanName": "[concat(parameters('deploymentName'), '-plan')]",
"functionAppName": "[concat(parameters('deploymentName'), '-function')]"
},
"resources": [
{
"apiVersion": "2019-06-01",
"type": "Microsoft.Storage/storageAccounts",
"name": "[variables('storageAccountName')]",
"location": "[resourceGroup().location]",
"sku": {
"name": "Standard_LRS"
},
"properties": {
"supportsHttpsTrafficOnly": true,
"minimumTlsVersion": "TLS1_2"
}
},
{
"type": "Microsoft.Web/serverfarms",
"apiVersion": "2016-09-01",
"name": "[variables('hostingPlanName')]",
"location": "[resourceGroup().location]",
"properties": {
"name": "[variables('hostingPlanName')]"
},
"sku": {
"name": "EP1",
"Tier": "ElasticPremium"
}
},
{
"apiVersion": "2018-11-01",
"type": "Microsoft.Web/sites",
"name": "[variables('functionAppName')]",
"location": "[resourceGroup().location]",
"kind": "functionapp",
"dependsOn": [
"[resourceId('Microsoft.Web/serverfarms', variables('hostingPlanName'))]",
"[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]"
],
"resources": [
{
"apiVersion": "2015-08-01",
"name": "web",
"type": "sourcecontrols",
"dependsOn": [
"[resourceId('Microsoft.Web/sites/', variables('functionAppName'))]"
],
"properties": {
"RepoUrl": "https://github.com/scale-tone/sftp-watcher",
"branch": "main",
"IsManualIntegration": true
}
}
],
"properties": {
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('hostingPlanName'))]",
"siteConfig": {
"appSettings": [
{
"name": "FOLDERS_TO_WATCH",
"value": "[parameters('FOLDERS_TO_WATCH')]"
},
{
"name": "POLLING_INTERVAL_CRON_EXP",
"value": "[parameters('POLLING_INTERVAL_CRON_EXP')]"
},
{
"name": "OUTPUT_QUEUE_OR_TOPIC_NAME",
"value": "[parameters('OUTPUT_QUEUE_OR_TOPIC_NAME')]"
},
{
"name": "SERVICE_BUS_CONN_STRING",
"value": "[parameters('SERVICE_BUS_CONN_STRING')]"
},
{
"name": "EVENT_GRID_TOPIC_KEY",
"value": "[parameters('EVENT_GRID_TOPIC_KEY')]"
},
{
"name": "AzureWebJobsStorage",
"value": "[concat('DefaultEndpointsProtocol=https;AccountName=',variables('storageAccountName'),';AccountKey=',listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), '2019-06-01').keys[0].value,';EndpointSuffix=','core.windows.net')]"
},
{
"name": "WEBSITE_CONTENTAZUREFILECONNECTIONSTRING",
"value": "[concat('DefaultEndpointsProtocol=https;AccountName=',variables('storageAccountName'),';AccountKey=',listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), '2019-06-01').keys[0].value,';EndpointSuffix=','core.windows.net')]"
},
{
"name": "WEBSITE_CONTENTSHARE",
"value": "[variables('functionAppName')]"
},
{
"name": "FUNCTIONS_EXTENSION_VERSION",
"value": "~4"
},
{
"name": "FUNCTIONS_WORKER_RUNTIME",
"value": "dotnet"
}
]
}
}
}
]
}