Skip to content

Commit 6ebcd40

Browse files
committed
Update the ARM Template and related files
1 parent db7a7f1 commit 6ebcd40

File tree

4 files changed

+81
-18
lines changed

4 files changed

+81
-18
lines changed

azuredeploy.json

Lines changed: 68 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,18 @@
99
"description": "The name of the web client app that you wish to create."
1010
}
1111
},
12-
"hostingPlanName": {
12+
"mySqlAdministratorLogin": {
1313
"type": "string",
14-
"defaultValue": "EDUGraphAPIPython",
14+
"defaultValue": "azureuser",
15+
"metadata": {
16+
"description": "The administrator login of the MySQL."
17+
}
18+
},
19+
"mySqlAdministratorLoginPassword": {
20+
"type": "securestring",
21+
"defaultValue": "P@ssw0rd",
1522
"metadata": {
16-
"description": "The hosting service plan name that you wish to create."
23+
"description": "The administrator login password of the MySQL."
1724
}
1825
},
1926
"sourceCodeRepositoryURL": {
@@ -45,37 +52,76 @@
4552
}
4653
},
4754
"clientSecret": {
48-
"type": "string",
55+
"type": "securestring",
4956
"defaultValue": "",
5057
"metadata": {
5158
"description": ""
5259
}
60+
},
61+
"clientCertificatePath": {
62+
"type": "string",
63+
"defaultValue": "app_only_cert.pfx",
64+
"metadata": {
65+
"description": "Path of the app-only certificate."
66+
}
67+
},
68+
"clientCertificatePassword": {
69+
"type": "securestring",
70+
"defaultValue": "J48W23RQeZv85vj",
71+
"metadata": {
72+
"description": "Password of the app-only certificate."
73+
}
5374
}
5475
},
5576
"variables": {
5677
"location": "[resourceGroup().location]",
57-
"lowerSiteName": "[toLower(parameters('siteName'))]",
58-
"webSiteName": "[variables('lowerSiteName')]",
78+
"hostingPlanName": "[parameters('siteName')]",
79+
"webSiteName": "[toLower(parameters('siteName'))]",
80+
"mySQLName": "[variables('webSiteName')]",
5981
"pythonSiteExtensionName": "python353x64"
6082
},
6183
"resources": [
6284
{
6385
"type": "Microsoft.Web/serverfarms",
6486
"sku": {
65-
"name": "F1",
66-
"tier": "Free",
67-
"size": "F1",
68-
"family": "F",
87+
"name": "B1",
88+
"tier": "Basic",
89+
"size": "B1",
90+
"family": "B",
6991
"capacity": 0
7092
},
71-
"name": "[parameters('hostingPlanName')]",
93+
"name": "[variables('hostingPlanName')]",
7294
"apiVersion": "2015-08-01",
7395
"location": "[variables('location')]",
7496
"properties": {
75-
"name": "[parameters('hostingPlanName')]",
97+
"name": "[variables('hostingPlanName')]",
7698
"numberOfWorkers": 1
7799
}
78100
},
101+
{
102+
"type": "Microsoft.DBforMySQL/servers",
103+
"apiVersion": "2017-12-01-preview",
104+
"kind": "",
105+
"location": "[variables('location')]",
106+
"name": "[variables('mySQLName')]",
107+
"properties": {
108+
"version": "5.7",
109+
"administratorLogin": "[parameters('mySqlAdministratorLogin')]",
110+
"administratorLoginPassword": "[parameters('mySqlAdministratorLoginPassword')]",
111+
"storageProfile": {
112+
"storageMB": 5120,
113+
"backupRetentionDays": "7",
114+
"geoRedundantBackup": "Disabled"
115+
}
116+
},
117+
"sku": {
118+
"name": "B_Gen4_1",
119+
"family": "Gen4",
120+
"tier": "Basic",
121+
"capacity": 1,
122+
"size": 5120
123+
}
124+
},
79125
{
80126
"type": "Microsoft.Web/sites",
81127
"kind": "app",
@@ -84,7 +130,10 @@
84130
"location": "[variables('location')]",
85131
"properties": {
86132
"name": "[variables('webSiteName')]",
87-
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', parameters('hostingPlanName'))]"
133+
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('hostingPlanName'))]",
134+
"siteConfig": {
135+
"AlwaysOn": true
136+
}
88137
},
89138
"resources": [
90139
{
@@ -106,6 +155,11 @@
106155
"properties": {
107156
"ClientId": "[parameters('clientId')]",
108157
"ClientSecret": "[parameters('clientSecret')]",
158+
"ClientCertificatePath": "[parameters('clientCertificatePath')]",
159+
"ClientCertificatePassword": "[parameters('clientCertificatePassword')]",
160+
"MySQLHost": "[concat(variables('mySQLName'), '.mysql.database.azure.com')]",
161+
"MySQLUser": "[parameters('mySqlAdministratorLogin')]",
162+
"MySQLPassword": "[parameters('mySqlAdministratorLoginPassword')]",
109163
"SourceCodeRepositoryUrl": "[parameters('SourceCodeRepositoryUrl')]",
110164
"command": "deploy.cmd"
111165
}
@@ -126,7 +180,7 @@
126180
}
127181
],
128182
"dependsOn": [
129-
"[resourceId('Microsoft.Web/serverfarms', parameters('hostingPlanName'))]"
183+
"[resourceId('Microsoft.Web/serverfarms', variables('hostingPlanName'))]"
130184
]
131185
}
132186
]

deploy.cmd

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,9 @@ IF EXIST "%DEPLOYMENT_SOURCE%\web.%PYTHON_VER%.config" (
126126
:: %PYTHON_EXE% manage.py collectstatic --noinput --clear
127127
::)
128128

129+
:: 6. Deploy WebJobs
130+
xcopy /y/s "%DEPLOYMENT_SOURCE%\webjobs" "%DEPLOYMENT_TARGET%\App_Data\jobs\triggered\"
131+
129132
popd
130133

131134
:postPython

requirements.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1+
# web app
12
adal==0.5.1
23
msgraph==0.1.2
34
PyJWT==1.6.1
4-
mysqlclient==1.3.12
5+
mysqlclient==1.3.12
6+
7+
# other packages used by data sync webjob
8+
peewee==3.3.4
9+
cryptography==2.2.2
10+
pyopenssl==17.5.0

webjobs/data_sync/requirements.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
adal=0.5.1
2-
peewee=3.3.3
1+
adal==0.5.1
2+
peewee==3.3.4
33
cryptography==2.2.2
4-
pyopenssl==17.5.0
4+
pyopenssl==17.5.0

0 commit comments

Comments
 (0)