{ "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "parameters": { "registryName": { "minLength": 5, "maxLength": 50, "type": "string", "metadata": { "description": "The name of the container registry." } }, "registrySku": { "type": "string", "defaultValue": "Standard", "metadata": { "description": "The SKU of the container registry." } }, "siteName": { "type": "string", "metadata": { "description": "Name of azure web app" } }, "DBServerName": { "type": "string", "metadata": { "description": "SQL server name will be appended to .database.windows.net" } } }, "variables": { "hostingPlanName": "[concat(parameters('siteName'), 'serviceplan')]", "location": "[resourceGroup().location]" }, "resources": [ { "type": "Microsoft.ContainerRegistry/registries", "name": "[parameters('registryName')]", "apiVersion": "2017-10-01", "sku": { "name": "[parameters('registrySku')]" }, "location": "[resourceGroup().location]", "tags": { "displayName": "Container Registry", "container.registry": "[parameters('registryName')]" }, "properties": { "adminUserEnabled": "true" } }, { "apiVersion": "2016-03-01", "name": "[parameters('siteName')]", "type": "Microsoft.Web/sites", "properties": { "name": "[parameters('siteName')]", "siteConfig": { "appSettings": [ { "name": "WEBSITES_ENABLE_APP_SERVICE_STORAGE", "value": "false" } ], "connectionStrings": [ { "name": "defaultConnection", "ConnectionString": "[concat('Data Source=tcp:',reference(concat('Microsoft.Sql/servers/', parameters('DBServerName'))).fullyQualifiedDomainName , ',1433;Initial Catalog=mhcdb;User Id=sqladmin;Password=P2ssw0rd1234;')]", "type": "SQLAzure" } ], "appCommandLine": "", "linuxFxVersion": "DOCKER|appsvc/sample-hello-world:latest" }, "serverFarmId": "[variables('hostingPlanName')]", "hostingEnvironment": "" }, "location": "[resourceGroup().location]", "dependsOn": [ "[concat('Microsoft.Web/serverfarms/', variables('hostingPlanName'))]" ] }, { "apiVersion": "2016-09-01", "name": "[variables('hostingPlanName')]", "type": "Microsoft.Web/serverfarms", "location": "[resourceGroup().location]", "properties": { "name": "[variables('hostingPlanName')]", "workerSizeId": 0, "reserved": true, "numberOfWorkers": "1", "hostingEnvironment": "" }, "sku": { "Tier": "Standard", "Name": "S1" }, "kind": "linux" }, { "type": "Microsoft.Sql/servers", "name": "[parameters('DBServerName')]", "apiVersion": "2015-05-01-preview", "location": "[variables('location')]", "properties": { "administratorLogin": "sqladmin", "administratorLoginPassword": "P2ssw0rd1234", "version": "12.0" }, "resources": [ { "type": "databases", "name": "mhcdb", "apiVersion": "2014-04-01-preview", "location": "[variables('location')]", "properties": { "collation": "SQL_Latin1_General_CP1_CI_AS", "edition": "Basic", "maxSizeBytes": "1073741824" }, "dependsOn": [ "[concat('Microsoft.Sql/servers/', parameters('DBServerName'))]" ] }, { "type": "firewallrules", "name": "AllowAllWindowsAzureIps", "apiVersion": "2014-04-01-preview", "location": "[variables('location')]", "properties": { "endIpAddress": "0.0.0.0", "startIpAddress": "0.0.0.0" }, "dependsOn": [ "[concat('Microsoft.Sql/servers/', parameters('DBServerName'))]" ] } ] } ] }