-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmcsc-webhook.json
138 lines (138 loc) · 4.06 KB
/
mcsc-webhook.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
{
"$schema": "http://schemas.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"functionAppsName": {
"type": "string",
"metadata": {
"description": "mcsc-webhook"
}
},
"storageAccountType": {
"type": "string",
"defaultValue": "Standard_LRS",
"allowedValues": [
"Standard_LRS"
],
"metadata": {
"description": "Storage Account type"
}
},
"serviceBusNamespaceName": {
"type": "string",
"metadata": {
"description": "The Azure Service Bus namespace connection string."
}
},
"facebookToken": {
"type": "string",
"metadata": {
"description": "The token used to connect to Facebook."
}
},
"instagramToken": {
"type": "string",
"metadata": {
"description": "The token used to connect to Instagram."
}
},
"repoURL": {
"type": "string",
"defaultValue": "https://github.com/Missing-Children-Society-Canada/webhooks"
},
"branch": {
"type": "string",
"defaultValue": "master"
}
},
"variables": {
"storageAccountName": "[concat('func', uniqueString(resourceGroup().id), 'storage')]",
"sbVersion": "2015-08-01",
"defaultSASKeyName": "RootManageSharedAccessKey",
"SBauthRuleResourceId": "[resourceId('Microsoft.ServiceBus/namespaces/authorizationRules', parameters('serviceBusNamespaceName'), variables('defaultSASKeyName'))]"
},
"resources": [{
"type": "Microsoft.Storage/storageAccounts",
"name": "[variables('storageAccountName')]",
"apiVersion": "2015-06-15",
"location": "[resourceGroup().location]",
"properties": {
"accountType": "[parameters('storageAccountType')]"
}
},
{
"apiVersion": "2016-03-01",
"type": "Microsoft.Web/sites",
"name": "[parameters('functionAppsName')]",
"location": "[resourceGroup().location]",
"kind": "functionapp",
"properties": {
"name": "[parameters('functionAppsName')]",
"clientAffinityEnabled": false,
"siteConfig": {
"cors": {
"allowedOrigins": [
"*"
]
},
"appSettings": [
{
"name": "FUNCTIONS_EXTENSION_VERSION",
"value": "~1"
},
{
"name": "AzureWebJobsStorage",
"value": "[concat('DefaultEndpointsProtocol=https;AccountName=',variables('storageAccountName'),';AccountKey=',listkeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), '2015-05-01-preview').key1,';')]"
},
{
"name": "AzureWebJobsDashboard",
"value": "[concat('DefaultEndpointsProtocol=https;AccountName=',variables('storageAccountName'),';AccountKey=',listkeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), '2015-05-01-preview').key1,';')]"
},
{
"name": "WEBSITE_CONTENTAZUREFILECONNECTIONSTRING",
"value": "[concat('DefaultEndpointsProtocol=https;AccountName=',variables('storageAccountName'),';AccountKey=',listkeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), '2015-05-01-preview').key1,';')]"
},
{
"name": "WEBSITE_CONTENTSHARE",
"value": "[toLower(parameters('functionAppsName'))]"
},
{
"name": "WEBSITE_NODE_DEFAULT_VERSION",
"value": "6.5.0"
},
{
"name": "APPINSIGHTS_INSTRUMENTATIONKEY",
"value": ""
},
{
"name": "AzureWebJobsServiceBus",
"value": "[listkeys(variables('SBauthRuleResourceId'), variables('sbVersion')).primaryConnectionString]"
},
{
"name": "FB_VERIFY_TOKEN",
"value": "[parameters('facebookToken')]"
},
{
"name": "IG_VERIFY_TOKEN",
"value": "[parameters('instagramToken')]"
}]
}
},
"dependsOn": [
"[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]"
],
"resources": [{
"apiVersion": "2015-08-01",
"name": "web",
"type": "sourcecontrols",
"dependsOn": [
"[resourceId('Microsoft.Web/Sites', parameters('functionAppsName'))]"
],
"properties": {
"RepoUrl": "[parameters('repoURL')]",
"branch": "[parameters('branch')]",
"IsManualIntegration": true
}
}]
}]
}