Skip to content

Instantly share code, notes, and snippets.

@anthonychu
Created October 3, 2017 21:51
Show Gist options
  • Save anthonychu/43c2d91e9618598a950a1213749f0d6a to your computer and use it in GitHub Desktop.
Save anthonychu/43c2d91e9618598a950a1213749f0d6a to your computer and use it in GitHub Desktop.
{
"$schema": "http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"siteName": {
"type": "String"
}
},
"variables": {
"dbLocation": "westus2",
"dbPairedLocation": "eastus",
"storageName": "[concat('todofunc', uniqueString(parameters('siteName'), resourceGroup().id))]",
"dbName": "[concat(parameters('siteName'), '-db')]"
},
"resources": [
{
"type": "Microsoft.Web/sites",
"kind": "functionapp",
"name": "[parameters('siteName')]",
"apiVersion": "2016-03-01",
"location": "[resourceGroup().location]",
"identity": {
"type": "systemAssigned"
},
"properties": {
"siteConfig": {
"appSettings": [
{
"name": "AzureWebJobsDashboard",
"value": "[concat('DefaultEndpointsProtocol=https;AccountName=',variables('storageName'),';AccountKey=',listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageName')), '2015-05-01-preview').key1)]"
},
{
"name": "AzureWebJobsStorage",
"value": "[concat('DefaultEndpointsProtocol=https;AccountName=',variables('storageName'),';AccountKey=',listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageName')), '2015-05-01-preview').key1)]"
},
{
"name": "FUNCTIONS_EXTENSION_VERSION",
"value": "~1"
},
{
"name": "WEBSITE_CONTENTAZUREFILECONNECTIONSTRING",
"value": "[concat('DefaultEndpointsProtocol=https;AccountName=',variables('storageName'),';AccountKey=',listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageName')), '2015-05-01-preview').key1)]"
},
{
"name": "WEBSITE_CONTENTSHARE",
"value": "[concat(toLower(parameters('siteName')), '8a8f')]"
},
{
"name": "WEBSITE_NODE_DEFAULT_VERSION",
"value": "6.5.0"
},
{
"name": "APPINSIGHTS_INSTRUMENTATIONKEY",
"value": "[reference(resourceId('microsoft.insights/components/', parameters('siteName')), '2015-05-01').InstrumentationKey]"
},
{
"name": "ROUTING_EXTENSION_VERSION",
"value": "~0.2"
},
{
"name": "COSMOS_DB_RESOURCE_ID",
"value": "[resourceId('Microsoft.DocumentDb/databaseAccounts', variables('dbName'))]"
}
]
},
"name": "[parameters('siteName')]",
"clientAffinityEnabled": false
},
"dependsOn": [
"[resourceId('Microsoft.Storage/storageAccounts', variables('storageName'))]",
"[resourceId('microsoft.insights/components/', parameters('siteName'))]"
]
},
{
"type": "Microsoft.Storage/storageAccounts",
"name": "[variables('storageName')]",
"apiVersion": "2015-05-01-preview",
"location": "[resourceGroup().location]",
"properties": {
"accountType": "Standard_LRS"
}
},
{
"type": "microsoft.insights/components",
"name": "[parameters('siteName')]",
"apiVersion": "2015-05-01",
"location": "East US",
"tags": {
"[concat('hidden-link:', resourceGroup().id, '/providers/Microsoft.Web/sites/', parameters('siteName'))]": "Resource"
},
"properties": {
"ApplicationId": "[parameters('siteName')]",
"Request_Source": "IbizaWebAppExtensionCreate"
}
},
{
"type": "Microsoft.DocumentDb/databaseAccounts",
"kind": "GlobalDocumentDB",
"name": "[variables('dbName')]",
"apiVersion": "2015-04-08",
"location": "[resourceGroup().location]",
"tags": {
"defaultExperience": "DocumentDB"
},
"properties": {
"databaseAccountOfferType": "Standard",
"locations": [
{
"id": "[concat(parameters('siteName'), '-', variables('dbLocation'))]",
"failoverPriority": 0,
"locationName": "[variables('dbLocation')]"
},
{
"id": "[concat(parameters('siteName'), '-', variables('dbPairedLocation'))]",
"failoverPriority": 1,
"locationName": "[variables('dbPairedLocation')]"
}
]
}
}
],
"outputs": {
"site": {
"type": "Object",
"value": "[reference(resourceId('microsoft.Web/sites/', parameters('siteName')), '2015-08-31-PREVIEW')]"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment