Created
November 6, 2018 07:59
-
-
Save johndowns/b3bcb5782a56b4646c72a2dcfff51de7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", | |
"contentVersion": "1.0.0.0", | |
"parameters": { | |
"storageAccountName": { | |
"type": "string", | |
"defaultValue": "[uniqueString(subscription().subscriptionId, resourceGroup().name)]" | |
}, | |
"containerName": { | |
"type": "string", | |
"defaultValue": "images" | |
}, | |
"functionsAppName": { | |
"type": "string", | |
"defaultValue": "[concat(uniqueString(subscription().subscriptionId, resourceGroup().name), 'fn')]" | |
} | |
}, | |
"variables": { | |
"serviceSasFunctionValues": { | |
"canonicalizedResource": "[concat('/blob/', parameters('storageAccountName'), '/', parameters('containerName'))]", | |
"signedResource": "c", | |
"signedPermission": "c", | |
"signedExpiry": "2050-01-01T00:00:00Z" | |
}, | |
"functionsAppServicePlanName": "AppServicePlan" | |
}, | |
"resources": [ | |
{ | |
"apiVersion": "2018-02-01", | |
"name": "[parameters('storageAccountName')]", | |
"location": "[resourceGroup().location]", | |
"type": "Microsoft.Storage/storageAccounts", | |
"sku": { | |
"name": "Standard_LRS" | |
}, | |
"kind": "StorageV2", | |
"properties": { | |
"supportsHttpsTrafficOnly": true, | |
"accessTier": "Hot", | |
"encryption": { | |
"services": { | |
"blob": { | |
"enabled": true | |
}, | |
"file": { | |
"enabled": true | |
} | |
}, | |
"keySource": "Microsoft.Storage" | |
} | |
}, | |
"resources": [ | |
{ | |
"name": "[concat('default/', parameters('containerName'))]", | |
"type": "blobServices/containers", | |
"apiVersion": "2018-03-01-preview", | |
"dependsOn": [ | |
"[parameters('storageAccountName')]" | |
] | |
} | |
] | |
}, | |
{ | |
"name": "[variables('functionsAppServicePlanName')]", | |
"type": "Microsoft.Web/serverfarms", | |
"location": "[resourceGroup().location]", | |
"apiVersion": "2016-09-01", | |
"sku": { | |
"name": "Y1", | |
"tier": "Dynamic", | |
"size": "Y1", | |
"family": "Y", | |
"capacity": 0 | |
}, | |
"kind": "functionapp", | |
"properties": { | |
"workerTierName": null, | |
"adminSiteName": null, | |
"hostingEnvironmentProfile": null, | |
"perSiteScaling": false, | |
"reserved": false, | |
"targetWorkerCount": 0, | |
"targetWorkerSizeId": 0 | |
} | |
}, | |
{ | |
"name": "[parameters('functionsAppName')]", | |
"type": "Microsoft.Web/sites", | |
"location": "[resourceGroup().location]", | |
"apiVersion": "2016-08-01", | |
"kind": "functionapp", | |
"properties": { | |
"enabled": true, | |
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('functionsAppServicePlanName'))]", | |
"reserved": false, | |
"siteConfig": { | |
"ftpsState": "Disabled" | |
} | |
}, | |
"resources": [ | |
{ | |
"name": "appsettings", | |
"type": "config", | |
"apiVersion": "2014-11-01", | |
"properties": { | |
"CreateBlobSas": "[concat('https://', parameters('storageAccountName'), '.blob.core.windows.net/', parameters('containerName'), '?', listServiceSas(parameters('storageAccountName'), '2018-02-01', variables('serviceSasFunctionValues')).serviceSasToken)]" | |
}, | |
"dependsOn": [ | |
"[resourceId('Microsoft.Web/sites', parameters('functionsAppName'))]" | |
] | |
} | |
], | |
"dependsOn": [ | |
"[resourceId('Microsoft.Web/serverfarms', variables('functionsAppServicePlanName'))]" | |
] | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment