Skip to content

Instantly share code, notes, and snippets.

@isaacabraham
Last active September 25, 2020 23:28
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 isaacabraham/e8ea934369a98eec1b5c23fb65caf603 to your computer and use it in GitHub Desktop.
Save isaacabraham/e8ea934369a98eec1b5c23fb65caf603 to your computer and use it in GitHub Desktop.
#r "nuget:Farmer"
open Farmer
open Farmer.Builders
let myFunctions = functions {
name "myFunctions"
}
let template = arm {
location Location.NorthEurope
add_resource myFunctions
}
template
|> Writer.quickWrite "template"
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"outputs": {},
"parameters": {},
"resources": [
{
"apiVersion": "2016-08-01",
"dependsOn": [
"myFunctions-ai",
"myFunctions-farm",
"myfunctionsstorage"
],
"kind": "functionapp",
"location": "northeurope",
"name": "myFunctions",
"properties": {
"httpsOnly": false,
"serverFarmId": "myFunctions-farm",
"siteConfig": {
"alwaysOn": false,
"appSettings": [
{
"name": "FUNCTIONS_WORKER_RUNTIME",
"value": "dotnet"
},
{
"name": "WEBSITE_NODE_DEFAULT_VERSION",
"value": "10.14.1"
},
{
"name": "FUNCTIONS_EXTENSION_VERSION",
"value": "~3"
},
{
"name": "AzureWebJobsStorage",
"value": "[concat('DefaultEndpointsProtocol=https;AccountName=myfunctionsstorage;AccountKey=', listKeys('myfunctionsstorage', '2017-10-01').keys[0].value)]"
},
{
"name": "AzureWebJobsDashboard",
"value": "[concat('DefaultEndpointsProtocol=https;AccountName=myfunctionsstorage;AccountKey=', listKeys('myfunctionsstorage', '2017-10-01').keys[0].value)]"
},
{
"name": "APPINSIGHTS_INSTRUMENTATIONKEY",
"value": "[reference('Microsoft.Insights/components/myFunctions-ai').InstrumentationKey]"
},
{
"name": "WEBSITE_CONTENTAZUREFILECONNECTIONSTRING",
"value": "[concat('DefaultEndpointsProtocol=https;AccountName=myfunctionsstorage;AccountKey=', listKeys('myfunctionsstorage', '2017-10-01').keys[0].value)]"
},
{
"name": "WEBSITE_CONTENTSHARE",
"value": "myfunctions"
}
],
"metadata": []
}
},
"tags": {},
"type": "Microsoft.Web/sites"
},
{
"apiVersion": "2018-02-01",
"location": "northeurope",
"name": "myFunctions-farm",
"properties": {
"name": "myFunctions-farm",
"perSiteScaling": false,
"reserved": false
},
"sku": {
"capacity": 0,
"name": "Y1",
"size": "Y1",
"tier": "Dynamic"
},
"tags": {},
"type": "Microsoft.Web/serverfarms"
},
{
"apiVersion": "2018-07-01",
"kind": "StorageV2",
"location": "northeurope",
"name": "myfunctionsstorage",
"properties": {
"isHnsEnabled": false
},
"sku": {
"name": "Standard_LRS"
},
"tags": {},
"type": "Microsoft.Storage/storageAccounts"
},
{
"apiVersion": "2014-04-01",
"kind": "web",
"location": "northeurope",
"name": "myFunctions-ai",
"properties": {
"ApplicationId": "myFunctions",
"Application_Type": "web",
"name": "myFunctions-ai"
},
"tags": {
"[concat('hidden-link:', resourceGroup().id, '/providers/Microsoft.Web/sites/', 'myFunctions')]": "Resource",
"displayName": "AppInsightsComponent"
},
"type": "Microsoft.Insights/components"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment