-
Notifications
You must be signed in to change notification settings - Fork 8
/
deploy.json
159 lines (159 loc) · 5.66 KB
/
deploy.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
157
158
159
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"baseName": {
"defaultValue": "srvlbot",
"type": "string",
"metadata": {
"description": "Name use as base-template to named the resources to be deployed in Azure."
}
},
"applicationId": {
"type": "string",
"metadata": {
"description": "Discord App ID. Go to discord applications page"
}
},
"applicationPublicKey": {
"type": "string",
"metadata": {
"description": "Discord App Public Key. Go to discord applications page"
}
},
"applicationToken": {
"type": "string",
"metadata": {
"description": "Discord bot Token. Go to discord applications page"
}
},
"guildId": {
"type": "string",
"defaultValue": "",
"metadata": {
"description": "Optional Guild ID to deploy the commands into. Default will deploy in every guild the bot has joined, but this can take up to an hour"
}
}
},
"variables": {
"suffix": "[substring(toLower(uniqueString(resourceGroup().id, resourceGroup().location)),0,5)]",
"funcAppName": "[toLower(concat(parameters('baseName'), variables('suffix')))]",
"funcStorageAccountName": "[tolower(concat(substring(parameters('baseName'), 0, min(length(parameters('baseName')),16)), variables('suffix'), 'stg'))]",
"funcHhostingPlanName": "[concat(substring(parameters('baseName'), 0, min(length(parameters('baseName')),14)), variables('suffix'), 'plan')]",
"insightsAppName": "[concat(substring(parameters('baseName'), 0, min(length(parameters('baseName')),14)), variables('suffix'), '-meta')]"
},
"resources": [
{
"apiVersion": "2018-11-01",
"name": "[variables('funcAppName')]",
"type": "Microsoft.Web/sites",
"kind": "functionapp,linux",
"location": "[resourceGroup().location]",
"dependsOn": [
"[concat('microsoft.insights/components/', variables('insightsAppName'))]",
"[concat('Microsoft.Web/serverfarms/', variables('funcHhostingPlanName'))]",
"[concat('Microsoft.Storage/storageAccounts/',variables('funcStorageAccountName'))]"
],
"properties": {
"name": "[variables('funcAppName')]",
"siteConfig": {
"appSettings": [
{
"name": "FUNCTIONS_EXTENSION_VERSION",
"value": "~3"
},
{
"name": "FUNCTIONS_WORKER_RUNTIME",
"value": "node"
},
{
"name": "WEBSITE_NODE_DEFAULT_VERSION",
"value": "10.14.1"
},
{
"name": "APPINSIGHTS_INSTRUMENTATIONKEY",
"value": "[reference(concat('microsoft.insights/components/', variables('insightsAppName')), '2015-05-01').InstrumentationKey]"
},
{
"name": "APPLICATIONINSIGHTS_CONNECTION_STRING",
"value": "[reference(concat('microsoft.insights/components/', variables('insightsAppName')), '2015-05-01').ConnectionString]"
},
{
"name": "AzureWebJobsStorage",
"value": "[concat('DefaultEndpointsProtocol=https;AccountName=',variables('funcStorageAccountName'),';AccountKey=',listKeys(resourceId('Microsoft.Storage/storageAccounts',variables('funcStorageAccountName')), '2019-06-01').keys[0].value,';EndpointSuffix=','core.windows.net')]"
},
{
"name": "BOT_APP_ID",
"value": "[parameters('applicationId')]"
},
{
"name": "BOT_APP_PUBLIC_KEY",
"value": "[parameters('applicationPublicKey')]"
},
{
"name": "BOT_APP_TOKEN",
"value": "[parameters('applicationToken')]"
},
{
"name": "COMMANDS_GUILD_ID",
"value": "[parameters('guildId')]"
},
{
"name": "WEBSITE_RUN_FROM_ZIP",
"value": "https://github.com/SoTrx/azure-serverless-discord-bot/releases/latest/download/default.azure-serverless-discord-bot.zip"
}
],
"use32BitWorkerProcess": false,
"linuxFxVersion": "Node|14"
},
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms/', variables('funcHhostingPlanName'))]",
"hostingEnvironment": "",
"clientAffinityEnabled": true
},
"resources": []
},
{
"apiVersion": "2019-08-01",
"name": "[variables('funcHhostingPlanName')]",
"type": "Microsoft.Web/serverfarms",
"location": "[resourceGroup().location]",
"kind": "app,linux",
"properties": {
"name": "[variables('funcHhostingPlanName')]",
"computeMode": "Dynamic",
"reserved": true
},
"sku": {
"Tier": "Dynamic",
"Name": "Y1"
}
},
{
"apiVersion": "2015-05-01",
"name": "[variables('insightsAppName')]",
"type": "microsoft.insights/components",
"location": "[resourceGroup().location]",
"kind": "",
"properties": {
"Application_Type": "web",
"ApplicationId": "[variables('funcAppName')]",
"Request_Source": "rest"
}
},
{
"apiVersion": "2019-06-01",
"type": "Microsoft.Storage/storageAccounts",
"name": "[variables('funcStorageAccountName')]",
"location": "[resourceGroup().location]",
"tags": {},
"sku": {
"name": "Standard_LRS"
},
"properties": {
"supportsHttpsTrafficOnly": true,
"minimumTlsVersion": "TLS1_2"
}
}
],
"outputs": {}
}