|
9 | 9 | "description": "The name of the web client app that you wish to create." |
10 | 10 | } |
11 | 11 | }, |
12 | | - "hostingPlanName": { |
| 12 | + "mySqlAdministratorLogin": { |
13 | 13 | "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", |
15 | 22 | "metadata": { |
16 | | - "description": "The hosting service plan name that you wish to create." |
| 23 | + "description": "The administrator login password of the MySQL." |
17 | 24 | } |
18 | 25 | }, |
19 | 26 | "sourceCodeRepositoryURL": { |
|
45 | 52 | } |
46 | 53 | }, |
47 | 54 | "clientSecret": { |
48 | | - "type": "string", |
| 55 | + "type": "securestring", |
49 | 56 | "defaultValue": "", |
50 | 57 | "metadata": { |
51 | 58 | "description": "" |
52 | 59 | } |
| 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 | + } |
53 | 74 | } |
54 | 75 | }, |
55 | 76 | "variables": { |
56 | 77 | "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')]", |
59 | 81 | "pythonSiteExtensionName": "python353x64" |
60 | 82 | }, |
61 | 83 | "resources": [ |
62 | 84 | { |
63 | 85 | "type": "Microsoft.Web/serverfarms", |
64 | 86 | "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", |
69 | 91 | "capacity": 0 |
70 | 92 | }, |
71 | | - "name": "[parameters('hostingPlanName')]", |
| 93 | + "name": "[variables('hostingPlanName')]", |
72 | 94 | "apiVersion": "2015-08-01", |
73 | 95 | "location": "[variables('location')]", |
74 | 96 | "properties": { |
75 | | - "name": "[parameters('hostingPlanName')]", |
| 97 | + "name": "[variables('hostingPlanName')]", |
76 | 98 | "numberOfWorkers": 1 |
77 | 99 | } |
78 | 100 | }, |
| 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 | + }, |
79 | 125 | { |
80 | 126 | "type": "Microsoft.Web/sites", |
81 | 127 | "kind": "app", |
|
84 | 130 | "location": "[variables('location')]", |
85 | 131 | "properties": { |
86 | 132 | "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 | + } |
88 | 137 | }, |
89 | 138 | "resources": [ |
90 | 139 | { |
|
106 | 155 | "properties": { |
107 | 156 | "ClientId": "[parameters('clientId')]", |
108 | 157 | "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')]", |
109 | 163 | "SourceCodeRepositoryUrl": "[parameters('SourceCodeRepositoryUrl')]", |
110 | 164 | "command": "deploy.cmd" |
111 | 165 | } |
|
126 | 180 | } |
127 | 181 | ], |
128 | 182 | "dependsOn": [ |
129 | | - "[resourceId('Microsoft.Web/serverfarms', parameters('hostingPlanName'))]" |
| 183 | + "[resourceId('Microsoft.Web/serverfarms', variables('hostingPlanName'))]" |
130 | 184 | ] |
131 | 185 | } |
132 | 186 | ] |
|
0 commit comments