1
+ {
2
+ "$schema" : " https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#" ,
3
+ "contentVersion" : " 1.0.0.0" ,
4
+ "metadata" : {
5
+ "_dependencyType" : " compute.function.linux.appService"
6
+ },
7
+ "parameters" : {
8
+ "resourceGroupName" : {
9
+ "type" : " string" ,
10
+ "defaultValue" : " rg-controlorigins-docs" ,
11
+ "metadata" : {
12
+ "description" : " Name of the resource group for the resource. It is recommended to put resources under same resource group for better tracking."
13
+ }
14
+ },
15
+ "resourceGroupLocation" : {
16
+ "type" : " string" ,
17
+ "defaultValue" : " southcentralus" ,
18
+ "metadata" : {
19
+ "description" : " Location of the resource group. Resource groups could have different location than resources, however by default we use API versions from latest hybrid profile which support all locations for resource types we support."
20
+ }
21
+ },
22
+ "resourceName" : {
23
+ "type" : " string" ,
24
+ "defaultValue" : " asyncdemo" ,
25
+ "metadata" : {
26
+ "description" : " Name of the main resource to be created by this template."
27
+ }
28
+ },
29
+ "resourceLocation" : {
30
+ "type" : " string" ,
31
+ "defaultValue" : " [parameters('resourceGroupLocation')]" ,
32
+ "metadata" : {
33
+ "description" : " Location of the resource. By default use resource group's location, unless the resource provider is not supported there."
34
+ }
35
+ }
36
+ },
37
+ "resources" : [
38
+ {
39
+ "type" : " Microsoft.Resources/resourceGroups" ,
40
+ "name" : " [parameters('resourceGroupName')]" ,
41
+ "location" : " [parameters('resourceGroupLocation')]" ,
42
+ "apiVersion" : " 2019-10-01"
43
+ },
44
+ {
45
+ "type" : " Microsoft.Resources/deployments" ,
46
+ "name" : " [concat(parameters('resourceGroupName'), 'Deployment', uniqueString(concat(parameters('resourceName'), subscription().subscriptionId)))]" ,
47
+ "resourceGroup" : " [parameters('resourceGroupName')]" ,
48
+ "apiVersion" : " 2019-10-01" ,
49
+ "dependsOn" : [
50
+ " [parameters('resourceGroupName')]"
51
+ ],
52
+ "properties" : {
53
+ "mode" : " Incremental" ,
54
+ "expressionEvaluationOptions" : {
55
+ "scope" : " inner"
56
+ },
57
+ "parameters" : {
58
+ "resourceGroupName" : {
59
+ "value" : " [parameters('resourceGroupName')]"
60
+ },
61
+ "resourceGroupLocation" : {
62
+ "value" : " [parameters('resourceGroupLocation')]"
63
+ },
64
+ "resourceName" : {
65
+ "value" : " [parameters('resourceName')]"
66
+ },
67
+ "resourceLocation" : {
68
+ "value" : " [parameters('resourceLocation')]"
69
+ }
70
+ },
71
+ "template" : {
72
+ "$schema" : " http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#" ,
73
+ "contentVersion" : " 1.0.0.0" ,
74
+ "parameters" : {
75
+ "resourceGroupName" : {
76
+ "type" : " string"
77
+ },
78
+ "resourceGroupLocation" : {
79
+ "type" : " string"
80
+ },
81
+ "resourceName" : {
82
+ "type" : " string"
83
+ },
84
+ "resourceLocation" : {
85
+ "type" : " string"
86
+ }
87
+ },
88
+ "variables" : {
89
+ "storage_name" : " [toLower(concat('storage', uniqueString(concat(parameters('resourceName'), subscription().subscriptionId))))]" ,
90
+ "appServicePlan_name" : " [concat('Plan', uniqueString(concat(parameters('resourceName'), subscription().subscriptionId)))]" ,
91
+ "storage_ResourceId" : " [concat('/subscriptions/', subscription().subscriptionId, '/resourceGroups/', parameters('resourceGroupName'), '/providers/Microsoft.Storage/storageAccounts/', variables('storage_name'))]" ,
92
+ "appServicePlan_ResourceId" : " [concat('/subscriptions/', subscription().subscriptionId, '/resourceGroups/', parameters('resourceGroupName'), '/providers/Microsoft.Web/serverFarms/', variables('appServicePlan_name'))]" ,
93
+ "function_ResourceId" : " [concat('/subscriptions/', subscription().subscriptionId, '/resourceGroups/', parameters('resourceGroupName'), '/providers/Microsoft.Web/sites/', parameters('resourceName'))]"
94
+ },
95
+ "resources" : [
96
+ {
97
+ "location" : " [parameters('resourceLocation')]" ,
98
+ "name" : " [parameters('resourceName')]" ,
99
+ "type" : " Microsoft.Web/sites" ,
100
+ "apiVersion" : " 2015-08-01" ,
101
+ "tags" : {
102
+ "[concat('hidden-related:', variables('appServicePlan_ResourceId'))]" : " empty"
103
+ },
104
+ "dependsOn" : [
105
+ " [variables('appServicePlan_ResourceId')]" ,
106
+ " [variables('storage_ResourceId')]"
107
+ ],
108
+ "kind" : " functionapp" ,
109
+ "properties" : {
110
+ "name" : " [parameters('resourceName')]" ,
111
+ "kind" : " functionapp" ,
112
+ "httpsOnly" : true ,
113
+ "reserved" : false ,
114
+ "serverFarmId" : " [variables('appServicePlan_ResourceId')]" ,
115
+ "siteConfig" : {
116
+ "alwaysOn" : true ,
117
+ "linuxFxVersion" : " dotnet|3.1"
118
+ }
119
+ },
120
+ "identity" : {
121
+ "type" : " SystemAssigned"
122
+ },
123
+ "resources" : [
124
+ {
125
+ "name" : " appsettings" ,
126
+ "type" : " config" ,
127
+ "apiVersion" : " 2015-08-01" ,
128
+ "dependsOn" : [
129
+ " [variables('function_ResourceId')]"
130
+ ],
131
+ "properties" : {
132
+ "AzureWebJobsStorage" : " [concat('DefaultEndpointsProtocol=https;AccountName=', variables('storage_name'), ';AccountKey=', listKeys(variables('storage_ResourceId'), '2017-10-01').keys[0].value, ';EndpointSuffix=', 'core.windows.net')]" ,
133
+ "FUNCTIONS_EXTENSION_VERSION" : " ~3" ,
134
+ "FUNCTIONS_WORKER_RUNTIME" : " dotnet"
135
+ }
136
+ }
137
+ ]
138
+ },
139
+ {
140
+ "location" : " [parameters('resourceGroupLocation')]" ,
141
+ "name" : " [variables('storage_name')]" ,
142
+ "type" : " Microsoft.Storage/storageAccounts" ,
143
+ "apiVersion" : " 2017-10-01" ,
144
+ "tags" : {
145
+ "[concat('hidden-related:', concat('/providers/Microsoft.Web/sites/', parameters('resourceName')))]" : " empty"
146
+ },
147
+ "properties" : {
148
+ "supportsHttpsTrafficOnly" : true
149
+ },
150
+ "sku" : {
151
+ "name" : " Standard_LRS"
152
+ },
153
+ "kind" : " Storage"
154
+ },
155
+ {
156
+ "location" : " [parameters('resourceGroupLocation')]" ,
157
+ "name" : " [variables('appServicePlan_name')]" ,
158
+ "type" : " Microsoft.Web/serverFarms" ,
159
+ "apiVersion" : " 2015-02-01" ,
160
+ "kind" : " linux" ,
161
+ "properties" : {
162
+ "name" : " [variables('appServicePlan_name')]" ,
163
+ "sku" : " Standard" ,
164
+ "workerSizeId" : " 0" ,
165
+ "reserved" : true
166
+ }
167
+ }
168
+ ]
169
+ }
170
+ }
171
+ }
172
+ ]
173
+ }
0 commit comments