profile.arm.json 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  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.windows.appService"
  6. },
  7. "parameters": {
  8. "resourceGroupName": {
  9. "type": "string",
  10. "defaultValue": "WepResourceGrp",
  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": "eastus",
  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": "mtwork",
  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. }
  118. },
  119. "identity": {
  120. "type": "SystemAssigned"
  121. },
  122. "resources": [
  123. {
  124. "name": "appsettings",
  125. "type": "config",
  126. "apiVersion": "2015-08-01",
  127. "dependsOn": [
  128. "[variables('function_ResourceId')]"
  129. ],
  130. "properties": {
  131. "AzureWebJobsStorage": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storage_name'), ';AccountKey=', listKeys(variables('storage_ResourceId'), '2017-10-01').keys[0].value, ';EndpointSuffix=', 'core.windows.net')]",
  132. "FUNCTIONS_EXTENSION_VERSION": "~3",
  133. "FUNCTIONS_WORKER_RUNTIME": "dotnet"
  134. }
  135. }
  136. ]
  137. },
  138. {
  139. "location": "[parameters('resourceGroupLocation')]",
  140. "name": "[variables('storage_name')]",
  141. "type": "Microsoft.Storage/storageAccounts",
  142. "apiVersion": "2017-10-01",
  143. "tags": {
  144. "[concat('hidden-related:', concat('/providers/Microsoft.Web/sites/', parameters('resourceName')))]": "empty"
  145. },
  146. "properties": {
  147. "supportsHttpsTrafficOnly": true
  148. },
  149. "sku": {
  150. "name": "Standard_LRS"
  151. },
  152. "kind": "Storage"
  153. },
  154. {
  155. "location": "[parameters('resourceGroupLocation')]",
  156. "name": "[variables('appServicePlan_name')]",
  157. "type": "Microsoft.Web/serverFarms",
  158. "apiVersion": "2015-08-01",
  159. "sku": {
  160. "name": "S1",
  161. "tier": "Standard",
  162. "family": "S",
  163. "size": "S1"
  164. },
  165. "properties": {
  166. "name": "[variables('appServicePlan_name')]"
  167. }
  168. }
  169. ]
  170. }
  171. }
  172. }
  173. ]
  174. }