1+ {
2+ "$schema" : " https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#" ,
3+ "contentVersion" : " 1.0.0.0" ,
4+ "parameters" : {
5+ "appName" : {
6+ "type" : " string" ,
7+ "metadata" : {
8+ "description" : " The name of the function app that you wish to create."
9+ }
10+ },
11+ "mailAddress" : {
12+ "type" : " string" ,
13+ "metadata" : {
14+ "description" : " Email address for Let's Encrypt account."
15+ }
16+ }
17+ },
18+ "variables" : {
19+ "functionAppName" : " [parameters('appName')]" ,
20+ "hostingPlanName" : " [parameters('appName')]" ,
21+ "storageAccountName" : " [concat(uniquestring(resourceGroup().id), 'azfunctions')]" ,
22+ "storageAccountId" : " [concat(resourceGroup().id, '/providers/', 'Microsoft.Storage/storageAccounts/', variables('storageAccountName'))]" ,
23+ "mailAddress" : " [parameters('mailAddress')]"
24+ },
25+ "resources" : [
26+ {
27+ "type" : " Microsoft.Storage/storageAccounts" ,
28+ "name" : " [variables('storageAccountName')]" ,
29+ "apiVersion" : " 2015-05-01-preview" ,
30+ "location" : " [resourceGroup().location]" ,
31+ "properties" : {
32+ "accountType" : " Standard_LRS"
33+ }
34+ },
35+ {
36+ "type" : " Microsoft.Web/serverfarms" ,
37+ "name" : " [variables('hostingPlanName')]" ,
38+ "apiVersion" : " 2015-04-01" ,
39+ "location" : " [resourceGroup().location]" ,
40+ "properties" : {
41+ "name" : " [variables('hostingPlanName')]" ,
42+ "computeMode" : " Dynamic" ,
43+ "sku" : " Dynamic"
44+ }
45+ },
46+ {
47+ "type" : " Microsoft.Insights/components" ,
48+ "name" : " [variables('functionAppName')]" ,
49+ "apiVersion" : " 2014-04-01" ,
50+ "location" : " [resourceGroup().location]" ,
51+ "tags" : {
52+ "[concat('hidden-link:', resourceGroup().id, '/providers/Microsoft.Web/sites/', variables('functionAppName'))]" : " Resource"
53+ },
54+ "properties" : {
55+ "applicationId" : " [variables('functionAppName')]"
56+ }
57+ },
58+ {
59+ "type" : " Microsoft.Web/sites" ,
60+ "name" : " [variables('functionAppName')]" ,
61+ "apiVersion" : " 2016-03-01" ,
62+ "location" : " [resourceGroup().location]" ,
63+ "kind" : " functionapp" ,
64+ "identity" : {
65+ "type" : " SystemAssigned"
66+ },
67+ "dependsOn" : [
68+ " [resourceId('Microsoft.Web/serverfarms', variables('hostingPlanName'))]" ,
69+ " [resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]" ,
70+ " [resourceId('Microsoft.Insights/components', variables('functionAppName'))]"
71+ ],
72+ "properties" : {
73+ "serverFarmId" : " [resourceId('Microsoft.Web/serverfarms', variables('hostingPlanName'))]" ,
74+ "siteConfig" : {
75+ "appSettings" : [
76+ {
77+ "name" : " APPINSIGHTS_INSTRUMENTATIONKEY" ,
78+ "value" : " [reference(resourceId('Microsoft.Insights/components', variables('functionAppName')), '2015-05-01').InstrumentationKey]"
79+ },
80+ {
81+ "name" : " AzureWebJobsDashboard" ,
82+ "value" : " [concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccountName'), ';AccountKey=', listKeys(variables('storageAccountId'),'2015-05-01-preview').key1)]"
83+ },
84+ {
85+ "name" : " AzureWebJobsStorage" ,
86+ "value" : " [concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccountName'), ';AccountKey=', listKeys(variables('storageAccountId'),'2015-05-01-preview').key1)]"
87+ },
88+ {
89+ "name" : " WEBSITE_CONTENTAZUREFILECONNECTIONSTRING" ,
90+ "value" : " [concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccountName'), ';AccountKey=', listKeys(variables('storageAccountId'),'2015-05-01-preview').key1)]"
91+ },
92+ {
93+ "name" : " WEBSITE_CONTENTSHARE" ,
94+ "value" : " [toLower(variables('functionAppName'))]"
95+ },
96+ {
97+ "name" : " WEBSITE_RUN_FROM_PACKAGE" ,
98+ "value" : " https://shibayan.blob.core.windows.net/azure-keyvault-letsencrypt/latest.zip"
99+ },
100+ {
101+ "name" : " FUNCTIONS_EXTENSION_VERSION" ,
102+ "value" : " ~2"
103+ },
104+ {
105+ "name" : " LetsEncrypt:SubscriptionId" ,
106+ "value" : " [subscription().subscriptionId]"
107+ },
108+ {
109+ "name" : " LetsEncrypt:Contacts" ,
110+ "value" : " [variables('mailAddress')]"
111+ }
112+ ],
113+ "clientAffinityEnabled" : false
114+ }
115+ }
116+ }
117+ ]
118+ }
0 commit comments