Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"variables": {
// Ensure the demo web app is unique within Azure
"uniqueSuffix": "[tolower(uniqueString(resourceGroup().Id))]",
"appPlanName": "[concat('demo-web-app-plan-', variables('uniqueSuffix'))]",
"appName": "[concat('demo-web-app-', variables('uniqueSuffix'))]",
// "Remote" Container Registry
"registrySubscriptionId": "CHANGETO-YOUR-SUBS-GUID-000000000000",
"registryResourceGroup": "container-registry-resource-group",
"registryName": "hompus",
"registryResourceId": "[resourceId(variables('registrySubscriptionId'), variables('registryResourceGroup'), 'Microsoft.ContainerRegistry/registries', variables('registryName'))]"
},
"resources": [
{
"type": "Microsoft.Web/serverfarms",
"apiVersion": "2018-02-01",
"name": "[variables('appPlanName')]",
"location": "[resourceGroup().location]",
"sku": {
"name": "B1",
"tier": "Basic"
},
"kind": "linux",
"properties": {
"reserved": true
}
},
{
"type": "Microsoft.Web/sites",
"apiVersion": "2018-11-01",
"name": "[variables('appName')]",
"location": "[resourceGroup().location]",
"kind": "app,linux,container",
"properties": {
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('appPlanName'))]"
},
"dependsOn": [
"[resourceId('Microsoft.Web/serverfarms', variables('appPlanName'))]"
]
},
{
"type": "Microsoft.Web/sites/config",
"apiVersion": "2018-11-01",
"name": "[concat(variables('appName'), '/web')]",
"properties": {
"linuxFxVersion": "DOCKER|hompus.azurecr.io/samples/nginx:latest"
},
"dependsOn": [
"[resourceId('Microsoft.Web/sites', variables('appName'))]"
]
},
{
"type": "Microsoft.Web/sites/config",
"apiVersion": "2018-11-01",
"name": "[concat(variables('appName'), '/appsettings')]",
"properties": {
"DOCKER_REGISTRY_SERVER_URL": "[reference(variables('registryResourceId'), '2019-05-01').loginServer]",
"DOCKER_REGISTRY_SERVER_USERNAME": "[listCredentials(variables('registryResourceId'), '2019-05-01').username]",
"DOCKER_REGISTRY_SERVER_PASSWORD": "[listCredentials(variables('registryResourceId'), '2019-05-01').passwords[0].value]",
"WEBSITES_ENABLE_APP_SERVICE_STORAGE": "false"
},
"dependsOn": [
"[resourceId('Microsoft.Web/sites', variables('appName'))]"
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.