|
33 | 33 | "adminPassword": {
|
34 | 34 | "type": "securestring",
|
35 | 35 | "minLength": 16,
|
| 36 | + "maxLength": 50, |
36 | 37 | "metadata": {
|
37 | 38 | "description": "The password for the admin account."
|
38 | 39 | }
|
|
52 | 53 | "description": "The SKU of the webapp hosting tier."
|
53 | 54 | }
|
54 | 55 | },
|
| 56 | + "sendgridSku": { |
| 57 | + "type": "string", |
| 58 | + "defaultValue": "free", |
| 59 | + "allowedValues": [ |
| 60 | + "free", |
| 61 | + "bronze", |
| 62 | + "silver", |
| 63 | + "gold", |
| 64 | + "platinum", |
| 65 | + "premier" |
| 66 | + ], |
| 67 | + "metadata": { |
| 68 | + "description": "The SKU of the Sendgrid email account." |
| 69 | + } |
| 70 | + }, |
55 | 71 | "databaseCores": {
|
56 | 72 | "type": "int",
|
57 | 73 | "defaultValue": 2,
|
|
124 | 140 | "databaseUserCredentials" : "[concat(uriComponent(concat(parameters('adminUserName'), '@', variables('databaseServerName'))), ':', parameters('adminPassword'))]",
|
125 | 141 | "databaseFqdn" : "[concat( variables('databaseServerName'), '.postgres.database.azure.com:', variables('databaseServerPort'))]",
|
126 | 142 | "databaseConnectionString": "[concat('pgsql://', variables('databaseUserCredentials'), '@', variables('databaseFqdn'), '/', parameters('databaseName'))]",
|
| 143 | + "sendgridAccountName": "[concat(parameters('appName'),'-email')]", |
127 | 144 | "appServicePlanName": "[concat(parameters('appName'),'-hosting')]",
|
128 | 145 | "analyticsName": "[concat(parameters('appName'),'-analytics')]",
|
129 | 146 | "appFqdn": "[concat(parameters('appName'),'.azurewebsites.net')]"
|
130 | 147 | },
|
131 | 148 | "resources": [
|
| 149 | + { |
| 150 | + "name": "[variables('sendgridAccountName')]", |
| 151 | + "type": "Sendgrid.Email/accounts", |
| 152 | + "apiVersion": "2015-01-01", |
| 153 | + "location": "[variables('location')]", |
| 154 | + "plan": { |
| 155 | + "name": "[parameters('sendgridSku')]", |
| 156 | + "publisher": "Sendgrid", |
| 157 | + "product": "sendgrid_azure", |
| 158 | + "promotionCode": "" |
| 159 | + }, |
| 160 | + "properties": { |
| 161 | + "acceptMarketingEmails": false, |
| 162 | + "email": "[parameters('adminContactEmail')]", |
| 163 | + "password": "[parameters('adminPassword')]" |
| 164 | + } |
| 165 | + }, |
132 | 166 | {
|
133 | 167 | "type": "Microsoft.Insights/components",
|
134 | 168 | "apiVersion": "2015-05-01",
|
|
207 | 241 | "kind": "app,linux,container",
|
208 | 242 | "location": "[variables('location')]",
|
209 | 243 | "dependsOn": [
|
| 244 | + "[resourceId('Sendgrid.Email/accounts', variables('sendgridAccountName'))]", |
210 | 245 | "[resourceId('Microsoft.DBforPostgreSQL/servers/', variables('databaseServerName'))]",
|
211 | 246 | "[resourceId('Microsoft.Insights/components', variables('analyticsName'))]",
|
212 | 247 | "[resourceId('Microsoft.Web/serverfarms', variables('appServicePlanName'))]"
|
|
261 | 296 | "name": "ADMIN_PASSWORD",
|
262 | 297 | "value": "[parameters('adminPassword')]"
|
263 | 298 | },
|
| 299 | + { |
| 300 | + "name": "EMAIL_USE_TLS", |
| 301 | + "value": "True" |
| 302 | + }, |
| 303 | + { |
| 304 | + "name": "EMAIL_HOST", |
| 305 | + "value": "[reference(resourceId('Sendgrid.Email/accounts', variables('sendgridAccountName'))).smtpServer]" |
| 306 | + }, |
| 307 | + { |
| 308 | + "name": "EMAIL_HOST_USER", |
| 309 | + "value": "[reference(resourceId('Sendgrid.Email/accounts', variables('sendgridAccountName'))).username]" |
| 310 | + }, |
| 311 | + { |
| 312 | + "name": "EMAIL_HOST_PASSWORD", |
| 313 | + "value": "[parameters('adminPassword')]" |
| 314 | + }, |
| 315 | + { |
| 316 | + "name": "EMAIL_PORT", |
| 317 | + "value": "587" |
| 318 | + }, |
264 | 319 | {
|
265 | 320 | "name": "DEBUG",
|
266 | 321 | "value": "False"
|
|
0 commit comments