Skip to content

Instantly share code, notes, and snippets.

@nshenoy
Created May 17, 2019 16:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nshenoy/6f6aafe5c67dac926188e4a38326b7fe to your computer and use it in GitHub Desktop.
Save nshenoy/6f6aafe5c67dac926188e4a38326b7fe to your computer and use it in GitHub Desktop.
{
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"webAppName": {
"type": "string"
},
"appServicePlanName": {
"type": "string"
},
"appServicePlanInstanceSize": {
"type": "string"
},
"appServicePlanPricingTier": {
"type": "string"
},
"appServicePlanFamily": {
"type": "string"
},
"appServicePlanCapacity": {
"type": "string"
},
"aseName": {
"type": "string"
},
"aseResourceGroupName": {
"type": "string"
},
"location": {
"type": "string"
},
"dockerRegistryName": {
"type": "string"
},
"dockerRegistryRepositoryName": {
"type": "string"
},
"dockerRegistryPassword": {
"type": "string"
}
},
"variables": {
"appInsightsServiceName": "[replace(parameters('webAppName'), '-app', '-ai')]",
"dockerRegistryUrl": "[concat('https//', parameters('dockerRegistryName'), '.azurecr.io')]",
"dockerImageName": "[concat(parameters('dockerRegistryName'), '.azurecr.io/', parameters('dockerRegistryRepositoryName'))]"
},
"resources": [
{
"type": "Microsoft.Web/serverfarms",
"apiVersion": "2018-02-01",
"kind": "linux",
"sku": {
"name": "[parameters('appServicePlanInstanceSize')]",
"tier": "[parameters('appServicePlanPricingTier')]",
"size": "[parameters('appServicePlanInstanceSize')]",
"family": "[parameters('appServicePlanFamily')]",
"capacity": "[parameters('appServicePlanCapacity')]"
},
"tags": {
"team": "[resourceGroup().tags.team]",
"department": "[resourceGroup().tags.department]",
"environment": "[resourceGroup().tags.environment]"
},
"name": "[parameters('appServicePlanName')]",
"location": "[parameters('location')]",
"properties": {
"name": "[parameters('appServicePlanName')]",
"reserved": true,
"perSiteScaling": false,
"targetWorkerCount": 1,
"targetWorkerSizeId": 0,
"hostingEnvironmentProfile": {
"id": "[resourceId(parameters('aseResourceGroupName'), 'Microsoft.Web/hostingEnvironments', parameters('aseName'))]"
}
}
},
{
"apiVersion": "2015-08-01",
"type": "Microsoft.Web/sites",
"name": "[parameters('webAppName')]",
"location": "[parameters('location')]",
"tags": {
"team": "[resourceGroup().tags.team]",
"department": "[resourceGroup().tags.department]",
"environment": "[resourceGroup().tags.environment]"
},
"dependsOn": [
"[resourceId('Microsoft.Web/serverfarms', parameters('appServicePlanName'))]",
"[resourceId('microsoft.insights/components', variables('appInsightsServiceName'))]"
],
"properties": {
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', parameters('appServicePlanName'))]",
"hostingEnvironmentProfile": {
"id": "[resourceId(parameters('aseResourceGroupName'), 'Microsoft.Web/hostingEnvironments', parameters('aseName'))]"
},
"siteConfig": {
"AlwaysOn": true,
"httpsOnly": true,
"appSettings": [
{
"name": "APPINSIGHTS_INSTRUMENTATIONKEY",
"value": "[reference(concat('microsoft.insights/components/', variables('appInsightsServiceName'))).InstrumentationKey]"
},
{
"name": "DOCKER_REGISTRY_SERVER_URL",
"value": "[variables('dockerRegistryUrl')]"
},
{
"name": "DOCKER_REGISTRY_SERVER_USERNAME",
"value": "[parameters('dockerRegistryName')]"
},
{
"name": "DOCKER_REGISTRY_SERVER_PASSWORD",
"value": "[parameters('dockerRegistryPassword')]"
}
],
"linuxFxVersion": "[concat('DOCKER|', variables('dockerImageName'))]"
}
}
},
{
"type": "microsoft.insights/components",
"kind": "other",
"name": "[variables('appInsightsServiceName')]",
"apiVersion": "2014-04-01",
"location": "[parameters('location')]",
"tags": {
"team": "[resourceGroup().tags.team]",
"department": "[resourceGroup().tags.department]",
"environment": "[resourceGroup().tags.environment]"
},
"scale": null,
"properties": {
"ApplicationId": "[variables('appInsightsServiceName')]"
},
"dependsOn": []
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment