|
| 1 | +{ |
| 2 | + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", |
| 3 | + "contentVersion": "1.0.0.0", |
| 4 | + "parameters": { |
| 5 | + "imagelocation":{ |
| 6 | + "type": "string" |
| 7 | + }, |
| 8 | + "acrcredentials": { |
| 9 | + "type": "secureObject" |
| 10 | + }, |
| 11 | + "baseName": { |
| 12 | + "type": "string", |
| 13 | + "maxLength": 10, |
| 14 | + "minLength": 3, |
| 15 | + "metadata": { |
| 16 | + "description": "The base name to use as prefix to create all the resources." |
| 17 | + } |
| 18 | + }, |
| 19 | + "location": { |
| 20 | + "type": "string", |
| 21 | + "defaultValue": "eastus", |
| 22 | + "allowedValues": [ |
| 23 | + "eastus", |
| 24 | + "eastus2", |
| 25 | + "southcentralus", |
| 26 | + "southeastasia", |
| 27 | + "westcentralus", |
| 28 | + "westeurope", |
| 29 | + "westus2", |
| 30 | + "centralus" |
| 31 | + ], |
| 32 | + "metadata": { |
| 33 | + "description": "Specifies the location for all resources." |
| 34 | + } |
| 35 | + }, |
| 36 | + "acr": { |
| 37 | + "type": "string", |
| 38 | + "defaultValue": "[concat(toLower(parameters('baseName')),'amlcr')]" |
| 39 | + }, |
| 40 | + "webAppName": { |
| 41 | + "type": "string", |
| 42 | + "defaultValue" : "[concat(toLower(parameters('baseName')),'webapp')]", |
| 43 | + "metadata": { |
| 44 | + "description": "Base name of the resource such as web app name and app service plan " |
| 45 | + }, |
| 46 | + "minLength": 2 |
| 47 | + } |
| 48 | + }, |
| 49 | + "variables": { |
| 50 | + "containerRegistryName": "[parameters('acr')]", |
| 51 | + "webAppPortalName": "[concat(parameters('webAppName'), '-webapp')]", |
| 52 | + "appServicePlanName": "[concat('AppServicePlan-', parameters('webAppName'))]" |
| 53 | + |
| 54 | + }, |
| 55 | + "resources": [ |
| 56 | + { |
| 57 | + "type": "Microsoft.Web/serverfarms", |
| 58 | + "apiVersion": "2018-02-01", |
| 59 | + "name": "[variables('appServicePlanName')]", |
| 60 | + "location": "[parameters('location')]", |
| 61 | + "sku": { |
| 62 | + "name": "S1" |
| 63 | + }, |
| 64 | + "kind": "linux", |
| 65 | + "properties":{ |
| 66 | + "reserved":true, |
| 67 | + "maximumElasticWorkerCount": 5 |
| 68 | + } |
| 69 | + }, |
| 70 | + { |
| 71 | + "type": "Microsoft.Web/sites", |
| 72 | + "apiVersion": "2018-11-01", |
| 73 | + "name": "[variables('webAppPortalName')]", |
| 74 | + "location": "[parameters('location')]", |
| 75 | + "kind": "app,linux,container", |
| 76 | + "dependsOn": [ |
| 77 | + "[resourceId('Microsoft.Web/serverfarms', variables('appServicePlanName'))]" |
| 78 | + ], |
| 79 | + "properties": { |
| 80 | + "serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('appServicePlanName'))]", |
| 81 | + "httpsOnly": true, |
| 82 | + "siteConfig": { |
| 83 | + "linuxFxVersion": "[concat('DOCKER|', parameters('imagelocation'))]", |
| 84 | + "appSettings": [ |
| 85 | + { |
| 86 | + "name": "WEBSITES_ENABLE_APP_SERVICE_STORAGE", |
| 87 | + "value": "false" |
| 88 | + }, |
| 89 | + { |
| 90 | + "name": "DOCKER_REGISTRY_SERVER_URL", |
| 91 | + "value": "[concat('https://', variables('containerRegistryName'), '.azurecr.io')]" |
| 92 | + }, |
| 93 | + { |
| 94 | + "name": "DOCKER_REGISTRY_SERVER_USERNAME", |
| 95 | + "value": "[parameters('acrcredentials').username.value]" |
| 96 | + }, |
| 97 | + { |
| 98 | + "name": "DOCKER_REGISTRY_SERVER_PASSWORD", |
| 99 | + "value": "[parameters('acrcredentials').password.value]" |
| 100 | + } |
| 101 | + ] |
| 102 | + } |
| 103 | + } |
| 104 | + } |
| 105 | + ] |
| 106 | + } |
0 commit comments