why does an ARM template create a separate app service plan?












-1















I'd like to understand why an entire app service plan was created, and not just an azure function along with app insights:



enter image description here



Is it not possible to create an Azure Function App without forcing the creation of an app service plan?



enter image description here



How do you create an Azure Function using an ARM template, without creating the App Service Plan component?



Here's my full template:



{
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"location": {
"type": "string"
},
"storageAccountName": {
"type": "string"
},
"accountType": {
"type": "string"
},
"appName": {
"type": "string"
}
},
"variables": {
"storageAccessTier": "Hot",
"storageKind": "StorageV2",
"supportsHttpsTrafficOnly": true,
"functionAppName": "[parameters('appName')]",
"applicationInsightsName": "[parameters('appName')]",
"storageAccountName": "[parameters('storageAccountName')]",
"storageAccountid": "[concat(resourceGroup().id,'/providers/','Microsoft.Storage/storageAccounts/', variables('storageAccountName'))]"
},
"resources": [
{
"name": "[variables('storageAccountName')]",
"type": "Microsoft.Storage/storageAccounts",
"apiVersion": "2018-07-01",
"location": "[parameters('location')]",
"properties": {
"accessTier": "[variables('storageAccessTier')]",
"supportsHttpsTrafficOnly": "[variables('supportsHttpsTrafficOnly')]"
},
"dependsOn": ,
"sku": {
"name": "[parameters('accountType')]"
},
"kind": "[variables('storageKind')]"
},
{
"apiVersion": "2015-08-01",
"type": "Microsoft.Web/sites",
"name": "[variables('functionAppName')]",
"location": "[parameters('location')]",
"kind": "functionapp",
"dependsOn": [
"[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]"
],
"properties": {
"siteConfig": {
"appSettings": [
{
"name": "AzureWebJobsDashboard",
"value": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccountName'), ';AccountKey=', listKeys(variables('storageAccountid'),'2015-05-01-preview').key1)]"
},
{
"name": "AzureWebJobsStorage",
"value": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccountName'), ';AccountKey=', listKeys(variables('storageAccountid'),'2015-05-01-preview').key1)]"
},
{
"name": "WEBSITE_CONTENTAZUREFILECONNECTIONSTRING",
"value": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccountName'), ';AccountKey=', listKeys(variables('storageAccountid'),'2015-05-01-preview').key1)]"
},
{
"name": "WEBSITE_CONTENTSHARE",
"value": "[toLower(variables('functionAppName'))]"
},
{
"name": "FUNCTIONS_EXTENSION_VERSION",
"value": "~1"
},
{
"name": "WEBSITE_NODE_DEFAULT_VERSION",
"value": "6.5.0"
},
{
"name": "APPINSIGHTS_INSTRUMENTATIONKEY",
"value": "[reference(resourceId('microsoft.insights/components/', variables('applicationInsightsName')), '2015-05-01').InstrumentationKey]"
}
]
}
}
},
{
"apiVersion": "2018-05-01-preview",
"name": "[variables('applicationInsightsName')]",
"type": "microsoft.insights/components",
"location": "[parameters('location')]",
"tags": {
"[concat('hidden-link:', resourceGroup().id, '/providers/Microsoft.Web/sites/', variables('applicationInsightsName'))]": "Resource"
},
"properties": {
"ApplicationId": "[variables('applicationInsightsName')]",
"Request_Source": "IbizaWebAppExtensionCreate"
}
}
],
"outputs": {}
}









share|improve this question



























    -1















    I'd like to understand why an entire app service plan was created, and not just an azure function along with app insights:



    enter image description here



    Is it not possible to create an Azure Function App without forcing the creation of an app service plan?



    enter image description here



    How do you create an Azure Function using an ARM template, without creating the App Service Plan component?



    Here's my full template:



    {
    "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
    "contentVersion": "1.0.0.0",
    "parameters": {
    "location": {
    "type": "string"
    },
    "storageAccountName": {
    "type": "string"
    },
    "accountType": {
    "type": "string"
    },
    "appName": {
    "type": "string"
    }
    },
    "variables": {
    "storageAccessTier": "Hot",
    "storageKind": "StorageV2",
    "supportsHttpsTrafficOnly": true,
    "functionAppName": "[parameters('appName')]",
    "applicationInsightsName": "[parameters('appName')]",
    "storageAccountName": "[parameters('storageAccountName')]",
    "storageAccountid": "[concat(resourceGroup().id,'/providers/','Microsoft.Storage/storageAccounts/', variables('storageAccountName'))]"
    },
    "resources": [
    {
    "name": "[variables('storageAccountName')]",
    "type": "Microsoft.Storage/storageAccounts",
    "apiVersion": "2018-07-01",
    "location": "[parameters('location')]",
    "properties": {
    "accessTier": "[variables('storageAccessTier')]",
    "supportsHttpsTrafficOnly": "[variables('supportsHttpsTrafficOnly')]"
    },
    "dependsOn": ,
    "sku": {
    "name": "[parameters('accountType')]"
    },
    "kind": "[variables('storageKind')]"
    },
    {
    "apiVersion": "2015-08-01",
    "type": "Microsoft.Web/sites",
    "name": "[variables('functionAppName')]",
    "location": "[parameters('location')]",
    "kind": "functionapp",
    "dependsOn": [
    "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]"
    ],
    "properties": {
    "siteConfig": {
    "appSettings": [
    {
    "name": "AzureWebJobsDashboard",
    "value": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccountName'), ';AccountKey=', listKeys(variables('storageAccountid'),'2015-05-01-preview').key1)]"
    },
    {
    "name": "AzureWebJobsStorage",
    "value": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccountName'), ';AccountKey=', listKeys(variables('storageAccountid'),'2015-05-01-preview').key1)]"
    },
    {
    "name": "WEBSITE_CONTENTAZUREFILECONNECTIONSTRING",
    "value": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccountName'), ';AccountKey=', listKeys(variables('storageAccountid'),'2015-05-01-preview').key1)]"
    },
    {
    "name": "WEBSITE_CONTENTSHARE",
    "value": "[toLower(variables('functionAppName'))]"
    },
    {
    "name": "FUNCTIONS_EXTENSION_VERSION",
    "value": "~1"
    },
    {
    "name": "WEBSITE_NODE_DEFAULT_VERSION",
    "value": "6.5.0"
    },
    {
    "name": "APPINSIGHTS_INSTRUMENTATIONKEY",
    "value": "[reference(resourceId('microsoft.insights/components/', variables('applicationInsightsName')), '2015-05-01').InstrumentationKey]"
    }
    ]
    }
    }
    },
    {
    "apiVersion": "2018-05-01-preview",
    "name": "[variables('applicationInsightsName')]",
    "type": "microsoft.insights/components",
    "location": "[parameters('location')]",
    "tags": {
    "[concat('hidden-link:', resourceGroup().id, '/providers/Microsoft.Web/sites/', variables('applicationInsightsName'))]": "Resource"
    },
    "properties": {
    "ApplicationId": "[variables('applicationInsightsName')]",
    "Request_Source": "IbizaWebAppExtensionCreate"
    }
    }
    ],
    "outputs": {}
    }









    share|improve this question

























      -1












      -1








      -1








      I'd like to understand why an entire app service plan was created, and not just an azure function along with app insights:



      enter image description here



      Is it not possible to create an Azure Function App without forcing the creation of an app service plan?



      enter image description here



      How do you create an Azure Function using an ARM template, without creating the App Service Plan component?



      Here's my full template:



      {
      "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
      "contentVersion": "1.0.0.0",
      "parameters": {
      "location": {
      "type": "string"
      },
      "storageAccountName": {
      "type": "string"
      },
      "accountType": {
      "type": "string"
      },
      "appName": {
      "type": "string"
      }
      },
      "variables": {
      "storageAccessTier": "Hot",
      "storageKind": "StorageV2",
      "supportsHttpsTrafficOnly": true,
      "functionAppName": "[parameters('appName')]",
      "applicationInsightsName": "[parameters('appName')]",
      "storageAccountName": "[parameters('storageAccountName')]",
      "storageAccountid": "[concat(resourceGroup().id,'/providers/','Microsoft.Storage/storageAccounts/', variables('storageAccountName'))]"
      },
      "resources": [
      {
      "name": "[variables('storageAccountName')]",
      "type": "Microsoft.Storage/storageAccounts",
      "apiVersion": "2018-07-01",
      "location": "[parameters('location')]",
      "properties": {
      "accessTier": "[variables('storageAccessTier')]",
      "supportsHttpsTrafficOnly": "[variables('supportsHttpsTrafficOnly')]"
      },
      "dependsOn": ,
      "sku": {
      "name": "[parameters('accountType')]"
      },
      "kind": "[variables('storageKind')]"
      },
      {
      "apiVersion": "2015-08-01",
      "type": "Microsoft.Web/sites",
      "name": "[variables('functionAppName')]",
      "location": "[parameters('location')]",
      "kind": "functionapp",
      "dependsOn": [
      "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]"
      ],
      "properties": {
      "siteConfig": {
      "appSettings": [
      {
      "name": "AzureWebJobsDashboard",
      "value": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccountName'), ';AccountKey=', listKeys(variables('storageAccountid'),'2015-05-01-preview').key1)]"
      },
      {
      "name": "AzureWebJobsStorage",
      "value": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccountName'), ';AccountKey=', listKeys(variables('storageAccountid'),'2015-05-01-preview').key1)]"
      },
      {
      "name": "WEBSITE_CONTENTAZUREFILECONNECTIONSTRING",
      "value": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccountName'), ';AccountKey=', listKeys(variables('storageAccountid'),'2015-05-01-preview').key1)]"
      },
      {
      "name": "WEBSITE_CONTENTSHARE",
      "value": "[toLower(variables('functionAppName'))]"
      },
      {
      "name": "FUNCTIONS_EXTENSION_VERSION",
      "value": "~1"
      },
      {
      "name": "WEBSITE_NODE_DEFAULT_VERSION",
      "value": "6.5.0"
      },
      {
      "name": "APPINSIGHTS_INSTRUMENTATIONKEY",
      "value": "[reference(resourceId('microsoft.insights/components/', variables('applicationInsightsName')), '2015-05-01').InstrumentationKey]"
      }
      ]
      }
      }
      },
      {
      "apiVersion": "2018-05-01-preview",
      "name": "[variables('applicationInsightsName')]",
      "type": "microsoft.insights/components",
      "location": "[parameters('location')]",
      "tags": {
      "[concat('hidden-link:', resourceGroup().id, '/providers/Microsoft.Web/sites/', variables('applicationInsightsName'))]": "Resource"
      },
      "properties": {
      "ApplicationId": "[variables('applicationInsightsName')]",
      "Request_Source": "IbizaWebAppExtensionCreate"
      }
      }
      ],
      "outputs": {}
      }









      share|improve this question














      I'd like to understand why an entire app service plan was created, and not just an azure function along with app insights:



      enter image description here



      Is it not possible to create an Azure Function App without forcing the creation of an app service plan?



      enter image description here



      How do you create an Azure Function using an ARM template, without creating the App Service Plan component?



      Here's my full template:



      {
      "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
      "contentVersion": "1.0.0.0",
      "parameters": {
      "location": {
      "type": "string"
      },
      "storageAccountName": {
      "type": "string"
      },
      "accountType": {
      "type": "string"
      },
      "appName": {
      "type": "string"
      }
      },
      "variables": {
      "storageAccessTier": "Hot",
      "storageKind": "StorageV2",
      "supportsHttpsTrafficOnly": true,
      "functionAppName": "[parameters('appName')]",
      "applicationInsightsName": "[parameters('appName')]",
      "storageAccountName": "[parameters('storageAccountName')]",
      "storageAccountid": "[concat(resourceGroup().id,'/providers/','Microsoft.Storage/storageAccounts/', variables('storageAccountName'))]"
      },
      "resources": [
      {
      "name": "[variables('storageAccountName')]",
      "type": "Microsoft.Storage/storageAccounts",
      "apiVersion": "2018-07-01",
      "location": "[parameters('location')]",
      "properties": {
      "accessTier": "[variables('storageAccessTier')]",
      "supportsHttpsTrafficOnly": "[variables('supportsHttpsTrafficOnly')]"
      },
      "dependsOn": ,
      "sku": {
      "name": "[parameters('accountType')]"
      },
      "kind": "[variables('storageKind')]"
      },
      {
      "apiVersion": "2015-08-01",
      "type": "Microsoft.Web/sites",
      "name": "[variables('functionAppName')]",
      "location": "[parameters('location')]",
      "kind": "functionapp",
      "dependsOn": [
      "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]"
      ],
      "properties": {
      "siteConfig": {
      "appSettings": [
      {
      "name": "AzureWebJobsDashboard",
      "value": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccountName'), ';AccountKey=', listKeys(variables('storageAccountid'),'2015-05-01-preview').key1)]"
      },
      {
      "name": "AzureWebJobsStorage",
      "value": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccountName'), ';AccountKey=', listKeys(variables('storageAccountid'),'2015-05-01-preview').key1)]"
      },
      {
      "name": "WEBSITE_CONTENTAZUREFILECONNECTIONSTRING",
      "value": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccountName'), ';AccountKey=', listKeys(variables('storageAccountid'),'2015-05-01-preview').key1)]"
      },
      {
      "name": "WEBSITE_CONTENTSHARE",
      "value": "[toLower(variables('functionAppName'))]"
      },
      {
      "name": "FUNCTIONS_EXTENSION_VERSION",
      "value": "~1"
      },
      {
      "name": "WEBSITE_NODE_DEFAULT_VERSION",
      "value": "6.5.0"
      },
      {
      "name": "APPINSIGHTS_INSTRUMENTATIONKEY",
      "value": "[reference(resourceId('microsoft.insights/components/', variables('applicationInsightsName')), '2015-05-01').InstrumentationKey]"
      }
      ]
      }
      }
      },
      {
      "apiVersion": "2018-05-01-preview",
      "name": "[variables('applicationInsightsName')]",
      "type": "microsoft.insights/components",
      "location": "[parameters('location')]",
      "tags": {
      "[concat('hidden-link:', resourceGroup().id, '/providers/Microsoft.Web/sites/', variables('applicationInsightsName'))]": "Resource"
      },
      "properties": {
      "ApplicationId": "[variables('applicationInsightsName')]",
      "Request_Source": "IbizaWebAppExtensionCreate"
      }
      }
      ],
      "outputs": {}
      }






      azure azure-resource-manager






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Jan 1 at 19:05









      l--''''''---------''''''''''''l--''''''---------''''''''''''

      11.2k233536883




      11.2k233536883
























          2 Answers
          2






          active

          oldest

          votes


















          1














          You may miss the serverFarmId in your template. Try the template below, it will not create a separate app service plan, in my sample, it attaches the Function App to the existing app service plan joyplan and storage account joystoragev1, creates app insight joytestfuninsight and attaches to it.



          Sample:



          {
          "$schema": "http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json#",
          "contentVersion": "1.0.0.0",
          "parameters": {
          "name": {
          "type": "String"
          },
          "storageName": {
          "type": "String"
          },
          "hostingPlanName": {
          "type": "String"
          },
          "location": {
          "type": "String"
          },
          "serverFarmResourceGroup": {
          "type": "String"
          },
          "subscriptionId": {
          "type": "String"
          }
          },
          "resources": [
          {
          "type": "Microsoft.Web/sites",
          "kind": "functionapp",
          "name": "[parameters('name')]",
          "apiVersion": "2016-03-01",
          "location": "[parameters('location')]",
          "properties": {
          "siteConfig": {
          "appSettings": [
          {
          "name": "FUNCTIONS_WORKER_RUNTIME",
          "value": "dotnet"
          },
          {
          "name": "AzureWebJobsStorage",
          "value": "[concat('DefaultEndpointsProtocol=https;AccountName=',parameters('storageName'),';AccountKey=',listKeys(resourceId('b83c1ed3-c5b6-44fb-b5ba-2b83a074c23f','joywebapp','Microsoft.Storage/storageAccounts', parameters('storageName')), '2015-05-01-preview').key1)]"
          },
          {
          "name": "FUNCTIONS_EXTENSION_VERSION",
          "value": "~2"
          },
          {
          "name": "WEBSITE_NODE_DEFAULT_VERSION",
          "value": "8.11.1"
          },
          {
          "name": "APPINSIGHTS_INSTRUMENTATIONKEY",
          "value": "[reference('microsoft.insights/components/joytestfuninsight', '2015-05-01').InstrumentationKey]"
          }
          ],
          "alwaysOn": true
          },
          "name": "[parameters('name')]",
          "clientAffinityEnabled": false,
          "serverFarmId": "[concat('/subscriptions/', parameters('subscriptionId'),'/resourcegroups/', parameters('serverFarmResourceGroup'), '/providers/Microsoft.Web/serverfarms/', parameters('hostingPlanName'))]"
          },
          "dependsOn": [
          "microsoft.insights/components/joytestfuninsight"
          ]
          },
          {
          "type": "microsoft.insights/components",
          "name": "joytestfuninsight",
          "apiVersion": "2015-05-01",
          "location": "eastus",
          "properties": {
          "ApplicationId": "[parameters('name')]",
          "Request_Source": "IbizaWebAppExtensionCreate"
          }
          }
          ]
          }


          My test parameters:



          {
          "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
          "contentVersion": "1.0.0.0",
          "parameters": {
          "name": {
          "value": "joytestfun"
          },
          "storageName": {
          "value": "joystoragev1"
          },
          "hostingPlanName": {
          "value": "joyplan"
          },
          "location": {
          "value": "Central US"
          },
          "serverFarmResourceGroup": {
          "value": "joywebapp"
          },
          "subscriptionId": {
          "value": "xxxxxxxxxxxxxxxxxxxx"
          }
          }
          }


          Update:



          If you want to create a Function App with a consumption plan, you could refer to the template below.



          Sample:



          {
          "$schema": "http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json#",
          "contentVersion": "1.0.0.0",
          "parameters": {
          "name": {
          "type": "String"
          },
          "storageName": {
          "type": "String"
          },
          "location": {
          "type": "String"
          },
          "subscriptionId": {
          "type": "String"
          }
          },
          "resources": [
          {
          "type": "Microsoft.Web/sites",
          "kind": "functionapp",
          "name": "[parameters('name')]",
          "apiVersion": "2016-03-01",
          "location": "Central US",
          "properties": {
          "siteConfig": {
          "appSettings": [
          {
          "name": "FUNCTIONS_WORKER_RUNTIME",
          "value": "dotnet"
          },
          {
          "name": "AzureWebJobsStorage",
          "value": "[concat('DefaultEndpointsProtocol=https;AccountName=',parameters('storageName'),';AccountKey=',listKeys(resourceId('b83c1ed3-xxxxxxxxxxx-2b83a074c23f','joywebapp','Microsoft.Storage/storageAccounts', parameters('storageName')), '2015-05-01-preview').key1)]"
          },
          {
          "name": "FUNCTIONS_EXTENSION_VERSION",
          "value": "~2"
          },
          {
          "name": "WEBSITE_CONTENTAZUREFILECONNECTIONSTRING",
          "value": "[concat('DefaultEndpointsProtocol=https;AccountName=',parameters('storageName'),';AccountKey=',listKeys(resourceId('b83c1ed3-xxxxxxxxxxx-2b83a074c23f','joywebapp','Microsoft.Storage/storageAccounts', parameters('storageName')), '2015-05-01-preview').key1)]"
          },
          {
          "name": "WEBSITE_CONTENTSHARE",
          "value": "[concat(toLower(parameters('name')), 'b32d')]"
          },
          {
          "name": "WEBSITE_NODE_DEFAULT_VERSION",
          "value": "8.11.1"
          },
          {
          "name": "APPINSIGHTS_INSTRUMENTATIONKEY",
          "value": "[reference('microsoft.insights/components/joytest11insight', '2015-05-01').InstrumentationKey]"
          }
          ]
          },
          "name": "[parameters('name')]",
          "clientAffinityEnabled": false,
          "reserved": false
          },
          "dependsOn": [
          "microsoft.insights/components/joytest11insight"
          ]
          },
          {
          "type": "microsoft.insights/components",
          "name": "joytest11insight",
          "apiVersion": "2015-05-01",
          "location": "eastus",
          "properties": {
          "ApplicationId": "[parameters('name')]",
          "Request_Source": "IbizaWebAppExtensionCreate"
          }
          }
          ]
          }


          My test parameters:



          {
          "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
          "contentVersion": "1.0.0.0",
          "parameters": {
          "name": {
          "value": "joytest11"
          },
          "storageName": {
          "value": "joystoragev1"
          },
          "location": {
          "value": "central us"
          },
          "subscriptionId": {
          "value": "b83c1ed3-xxxxxxxxxxx-2b83a074c23f"
          }
          }
          }





          share|improve this answer


























          • again, there's no need at all for an app service plan. i'm not sure why it's only enforced through ARM template, and not when you deploying from vs

            – l--''''''---------''''''''''''
            Jan 2 at 1:47











          • @l--''''''---------'''''''''''' The function must have a service plan or consumption plan, you could check your function created from vs in the portal, does it have a consumption plan?

            – Joy Wang
            Jan 2 at 1:55











          • yes it does have a consumption plan

            – l--''''''---------''''''''''''
            Jan 2 at 15:54











          • i suppose the question is, how do you get it to do a consumption plan

            – l--''''''---------''''''''''''
            Jan 2 at 15:54











          • @l--''''''---------'''''''''''' If you want to create a Function App with a consumption plan, you could see my update.

            – Joy Wang
            Jan 3 at 2:03



















          0














          Azure Function requires app service plan to operate, so you cant really create Azure Function without one.



          You can attach new Azure Function to already existing App Service plan, thats about it.






          share|improve this answer
























          • im not sure if that's true. if you create an azure function in visual studio and right click --> deploy , it will create that function without having to create a service plan for it

            – l--''''''---------''''''''''''
            Jan 1 at 19:26











          • hm, weird, it appears it definitely doesnt create app service plan on consumption anymore... mhm, never mind, it just doesnt appear instantly, its there. docs.microsoft.com/en-us/azure/azure-functions/functions-scale

            – 4c74356b41
            Jan 1 at 19:43













          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53998174%2fwhy-does-an-arm-template-create-a-separate-app-service-plan%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          2 Answers
          2






          active

          oldest

          votes








          2 Answers
          2






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          1














          You may miss the serverFarmId in your template. Try the template below, it will not create a separate app service plan, in my sample, it attaches the Function App to the existing app service plan joyplan and storage account joystoragev1, creates app insight joytestfuninsight and attaches to it.



          Sample:



          {
          "$schema": "http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json#",
          "contentVersion": "1.0.0.0",
          "parameters": {
          "name": {
          "type": "String"
          },
          "storageName": {
          "type": "String"
          },
          "hostingPlanName": {
          "type": "String"
          },
          "location": {
          "type": "String"
          },
          "serverFarmResourceGroup": {
          "type": "String"
          },
          "subscriptionId": {
          "type": "String"
          }
          },
          "resources": [
          {
          "type": "Microsoft.Web/sites",
          "kind": "functionapp",
          "name": "[parameters('name')]",
          "apiVersion": "2016-03-01",
          "location": "[parameters('location')]",
          "properties": {
          "siteConfig": {
          "appSettings": [
          {
          "name": "FUNCTIONS_WORKER_RUNTIME",
          "value": "dotnet"
          },
          {
          "name": "AzureWebJobsStorage",
          "value": "[concat('DefaultEndpointsProtocol=https;AccountName=',parameters('storageName'),';AccountKey=',listKeys(resourceId('b83c1ed3-c5b6-44fb-b5ba-2b83a074c23f','joywebapp','Microsoft.Storage/storageAccounts', parameters('storageName')), '2015-05-01-preview').key1)]"
          },
          {
          "name": "FUNCTIONS_EXTENSION_VERSION",
          "value": "~2"
          },
          {
          "name": "WEBSITE_NODE_DEFAULT_VERSION",
          "value": "8.11.1"
          },
          {
          "name": "APPINSIGHTS_INSTRUMENTATIONKEY",
          "value": "[reference('microsoft.insights/components/joytestfuninsight', '2015-05-01').InstrumentationKey]"
          }
          ],
          "alwaysOn": true
          },
          "name": "[parameters('name')]",
          "clientAffinityEnabled": false,
          "serverFarmId": "[concat('/subscriptions/', parameters('subscriptionId'),'/resourcegroups/', parameters('serverFarmResourceGroup'), '/providers/Microsoft.Web/serverfarms/', parameters('hostingPlanName'))]"
          },
          "dependsOn": [
          "microsoft.insights/components/joytestfuninsight"
          ]
          },
          {
          "type": "microsoft.insights/components",
          "name": "joytestfuninsight",
          "apiVersion": "2015-05-01",
          "location": "eastus",
          "properties": {
          "ApplicationId": "[parameters('name')]",
          "Request_Source": "IbizaWebAppExtensionCreate"
          }
          }
          ]
          }


          My test parameters:



          {
          "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
          "contentVersion": "1.0.0.0",
          "parameters": {
          "name": {
          "value": "joytestfun"
          },
          "storageName": {
          "value": "joystoragev1"
          },
          "hostingPlanName": {
          "value": "joyplan"
          },
          "location": {
          "value": "Central US"
          },
          "serverFarmResourceGroup": {
          "value": "joywebapp"
          },
          "subscriptionId": {
          "value": "xxxxxxxxxxxxxxxxxxxx"
          }
          }
          }


          Update:



          If you want to create a Function App with a consumption plan, you could refer to the template below.



          Sample:



          {
          "$schema": "http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json#",
          "contentVersion": "1.0.0.0",
          "parameters": {
          "name": {
          "type": "String"
          },
          "storageName": {
          "type": "String"
          },
          "location": {
          "type": "String"
          },
          "subscriptionId": {
          "type": "String"
          }
          },
          "resources": [
          {
          "type": "Microsoft.Web/sites",
          "kind": "functionapp",
          "name": "[parameters('name')]",
          "apiVersion": "2016-03-01",
          "location": "Central US",
          "properties": {
          "siteConfig": {
          "appSettings": [
          {
          "name": "FUNCTIONS_WORKER_RUNTIME",
          "value": "dotnet"
          },
          {
          "name": "AzureWebJobsStorage",
          "value": "[concat('DefaultEndpointsProtocol=https;AccountName=',parameters('storageName'),';AccountKey=',listKeys(resourceId('b83c1ed3-xxxxxxxxxxx-2b83a074c23f','joywebapp','Microsoft.Storage/storageAccounts', parameters('storageName')), '2015-05-01-preview').key1)]"
          },
          {
          "name": "FUNCTIONS_EXTENSION_VERSION",
          "value": "~2"
          },
          {
          "name": "WEBSITE_CONTENTAZUREFILECONNECTIONSTRING",
          "value": "[concat('DefaultEndpointsProtocol=https;AccountName=',parameters('storageName'),';AccountKey=',listKeys(resourceId('b83c1ed3-xxxxxxxxxxx-2b83a074c23f','joywebapp','Microsoft.Storage/storageAccounts', parameters('storageName')), '2015-05-01-preview').key1)]"
          },
          {
          "name": "WEBSITE_CONTENTSHARE",
          "value": "[concat(toLower(parameters('name')), 'b32d')]"
          },
          {
          "name": "WEBSITE_NODE_DEFAULT_VERSION",
          "value": "8.11.1"
          },
          {
          "name": "APPINSIGHTS_INSTRUMENTATIONKEY",
          "value": "[reference('microsoft.insights/components/joytest11insight', '2015-05-01').InstrumentationKey]"
          }
          ]
          },
          "name": "[parameters('name')]",
          "clientAffinityEnabled": false,
          "reserved": false
          },
          "dependsOn": [
          "microsoft.insights/components/joytest11insight"
          ]
          },
          {
          "type": "microsoft.insights/components",
          "name": "joytest11insight",
          "apiVersion": "2015-05-01",
          "location": "eastus",
          "properties": {
          "ApplicationId": "[parameters('name')]",
          "Request_Source": "IbizaWebAppExtensionCreate"
          }
          }
          ]
          }


          My test parameters:



          {
          "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
          "contentVersion": "1.0.0.0",
          "parameters": {
          "name": {
          "value": "joytest11"
          },
          "storageName": {
          "value": "joystoragev1"
          },
          "location": {
          "value": "central us"
          },
          "subscriptionId": {
          "value": "b83c1ed3-xxxxxxxxxxx-2b83a074c23f"
          }
          }
          }





          share|improve this answer


























          • again, there's no need at all for an app service plan. i'm not sure why it's only enforced through ARM template, and not when you deploying from vs

            – l--''''''---------''''''''''''
            Jan 2 at 1:47











          • @l--''''''---------'''''''''''' The function must have a service plan or consumption plan, you could check your function created from vs in the portal, does it have a consumption plan?

            – Joy Wang
            Jan 2 at 1:55











          • yes it does have a consumption plan

            – l--''''''---------''''''''''''
            Jan 2 at 15:54











          • i suppose the question is, how do you get it to do a consumption plan

            – l--''''''---------''''''''''''
            Jan 2 at 15:54











          • @l--''''''---------'''''''''''' If you want to create a Function App with a consumption plan, you could see my update.

            – Joy Wang
            Jan 3 at 2:03
















          1














          You may miss the serverFarmId in your template. Try the template below, it will not create a separate app service plan, in my sample, it attaches the Function App to the existing app service plan joyplan and storage account joystoragev1, creates app insight joytestfuninsight and attaches to it.



          Sample:



          {
          "$schema": "http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json#",
          "contentVersion": "1.0.0.0",
          "parameters": {
          "name": {
          "type": "String"
          },
          "storageName": {
          "type": "String"
          },
          "hostingPlanName": {
          "type": "String"
          },
          "location": {
          "type": "String"
          },
          "serverFarmResourceGroup": {
          "type": "String"
          },
          "subscriptionId": {
          "type": "String"
          }
          },
          "resources": [
          {
          "type": "Microsoft.Web/sites",
          "kind": "functionapp",
          "name": "[parameters('name')]",
          "apiVersion": "2016-03-01",
          "location": "[parameters('location')]",
          "properties": {
          "siteConfig": {
          "appSettings": [
          {
          "name": "FUNCTIONS_WORKER_RUNTIME",
          "value": "dotnet"
          },
          {
          "name": "AzureWebJobsStorage",
          "value": "[concat('DefaultEndpointsProtocol=https;AccountName=',parameters('storageName'),';AccountKey=',listKeys(resourceId('b83c1ed3-c5b6-44fb-b5ba-2b83a074c23f','joywebapp','Microsoft.Storage/storageAccounts', parameters('storageName')), '2015-05-01-preview').key1)]"
          },
          {
          "name": "FUNCTIONS_EXTENSION_VERSION",
          "value": "~2"
          },
          {
          "name": "WEBSITE_NODE_DEFAULT_VERSION",
          "value": "8.11.1"
          },
          {
          "name": "APPINSIGHTS_INSTRUMENTATIONKEY",
          "value": "[reference('microsoft.insights/components/joytestfuninsight', '2015-05-01').InstrumentationKey]"
          }
          ],
          "alwaysOn": true
          },
          "name": "[parameters('name')]",
          "clientAffinityEnabled": false,
          "serverFarmId": "[concat('/subscriptions/', parameters('subscriptionId'),'/resourcegroups/', parameters('serverFarmResourceGroup'), '/providers/Microsoft.Web/serverfarms/', parameters('hostingPlanName'))]"
          },
          "dependsOn": [
          "microsoft.insights/components/joytestfuninsight"
          ]
          },
          {
          "type": "microsoft.insights/components",
          "name": "joytestfuninsight",
          "apiVersion": "2015-05-01",
          "location": "eastus",
          "properties": {
          "ApplicationId": "[parameters('name')]",
          "Request_Source": "IbizaWebAppExtensionCreate"
          }
          }
          ]
          }


          My test parameters:



          {
          "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
          "contentVersion": "1.0.0.0",
          "parameters": {
          "name": {
          "value": "joytestfun"
          },
          "storageName": {
          "value": "joystoragev1"
          },
          "hostingPlanName": {
          "value": "joyplan"
          },
          "location": {
          "value": "Central US"
          },
          "serverFarmResourceGroup": {
          "value": "joywebapp"
          },
          "subscriptionId": {
          "value": "xxxxxxxxxxxxxxxxxxxx"
          }
          }
          }


          Update:



          If you want to create a Function App with a consumption plan, you could refer to the template below.



          Sample:



          {
          "$schema": "http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json#",
          "contentVersion": "1.0.0.0",
          "parameters": {
          "name": {
          "type": "String"
          },
          "storageName": {
          "type": "String"
          },
          "location": {
          "type": "String"
          },
          "subscriptionId": {
          "type": "String"
          }
          },
          "resources": [
          {
          "type": "Microsoft.Web/sites",
          "kind": "functionapp",
          "name": "[parameters('name')]",
          "apiVersion": "2016-03-01",
          "location": "Central US",
          "properties": {
          "siteConfig": {
          "appSettings": [
          {
          "name": "FUNCTIONS_WORKER_RUNTIME",
          "value": "dotnet"
          },
          {
          "name": "AzureWebJobsStorage",
          "value": "[concat('DefaultEndpointsProtocol=https;AccountName=',parameters('storageName'),';AccountKey=',listKeys(resourceId('b83c1ed3-xxxxxxxxxxx-2b83a074c23f','joywebapp','Microsoft.Storage/storageAccounts', parameters('storageName')), '2015-05-01-preview').key1)]"
          },
          {
          "name": "FUNCTIONS_EXTENSION_VERSION",
          "value": "~2"
          },
          {
          "name": "WEBSITE_CONTENTAZUREFILECONNECTIONSTRING",
          "value": "[concat('DefaultEndpointsProtocol=https;AccountName=',parameters('storageName'),';AccountKey=',listKeys(resourceId('b83c1ed3-xxxxxxxxxxx-2b83a074c23f','joywebapp','Microsoft.Storage/storageAccounts', parameters('storageName')), '2015-05-01-preview').key1)]"
          },
          {
          "name": "WEBSITE_CONTENTSHARE",
          "value": "[concat(toLower(parameters('name')), 'b32d')]"
          },
          {
          "name": "WEBSITE_NODE_DEFAULT_VERSION",
          "value": "8.11.1"
          },
          {
          "name": "APPINSIGHTS_INSTRUMENTATIONKEY",
          "value": "[reference('microsoft.insights/components/joytest11insight', '2015-05-01').InstrumentationKey]"
          }
          ]
          },
          "name": "[parameters('name')]",
          "clientAffinityEnabled": false,
          "reserved": false
          },
          "dependsOn": [
          "microsoft.insights/components/joytest11insight"
          ]
          },
          {
          "type": "microsoft.insights/components",
          "name": "joytest11insight",
          "apiVersion": "2015-05-01",
          "location": "eastus",
          "properties": {
          "ApplicationId": "[parameters('name')]",
          "Request_Source": "IbizaWebAppExtensionCreate"
          }
          }
          ]
          }


          My test parameters:



          {
          "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
          "contentVersion": "1.0.0.0",
          "parameters": {
          "name": {
          "value": "joytest11"
          },
          "storageName": {
          "value": "joystoragev1"
          },
          "location": {
          "value": "central us"
          },
          "subscriptionId": {
          "value": "b83c1ed3-xxxxxxxxxxx-2b83a074c23f"
          }
          }
          }





          share|improve this answer


























          • again, there's no need at all for an app service plan. i'm not sure why it's only enforced through ARM template, and not when you deploying from vs

            – l--''''''---------''''''''''''
            Jan 2 at 1:47











          • @l--''''''---------'''''''''''' The function must have a service plan or consumption plan, you could check your function created from vs in the portal, does it have a consumption plan?

            – Joy Wang
            Jan 2 at 1:55











          • yes it does have a consumption plan

            – l--''''''---------''''''''''''
            Jan 2 at 15:54











          • i suppose the question is, how do you get it to do a consumption plan

            – l--''''''---------''''''''''''
            Jan 2 at 15:54











          • @l--''''''---------'''''''''''' If you want to create a Function App with a consumption plan, you could see my update.

            – Joy Wang
            Jan 3 at 2:03














          1












          1








          1







          You may miss the serverFarmId in your template. Try the template below, it will not create a separate app service plan, in my sample, it attaches the Function App to the existing app service plan joyplan and storage account joystoragev1, creates app insight joytestfuninsight and attaches to it.



          Sample:



          {
          "$schema": "http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json#",
          "contentVersion": "1.0.0.0",
          "parameters": {
          "name": {
          "type": "String"
          },
          "storageName": {
          "type": "String"
          },
          "hostingPlanName": {
          "type": "String"
          },
          "location": {
          "type": "String"
          },
          "serverFarmResourceGroup": {
          "type": "String"
          },
          "subscriptionId": {
          "type": "String"
          }
          },
          "resources": [
          {
          "type": "Microsoft.Web/sites",
          "kind": "functionapp",
          "name": "[parameters('name')]",
          "apiVersion": "2016-03-01",
          "location": "[parameters('location')]",
          "properties": {
          "siteConfig": {
          "appSettings": [
          {
          "name": "FUNCTIONS_WORKER_RUNTIME",
          "value": "dotnet"
          },
          {
          "name": "AzureWebJobsStorage",
          "value": "[concat('DefaultEndpointsProtocol=https;AccountName=',parameters('storageName'),';AccountKey=',listKeys(resourceId('b83c1ed3-c5b6-44fb-b5ba-2b83a074c23f','joywebapp','Microsoft.Storage/storageAccounts', parameters('storageName')), '2015-05-01-preview').key1)]"
          },
          {
          "name": "FUNCTIONS_EXTENSION_VERSION",
          "value": "~2"
          },
          {
          "name": "WEBSITE_NODE_DEFAULT_VERSION",
          "value": "8.11.1"
          },
          {
          "name": "APPINSIGHTS_INSTRUMENTATIONKEY",
          "value": "[reference('microsoft.insights/components/joytestfuninsight', '2015-05-01').InstrumentationKey]"
          }
          ],
          "alwaysOn": true
          },
          "name": "[parameters('name')]",
          "clientAffinityEnabled": false,
          "serverFarmId": "[concat('/subscriptions/', parameters('subscriptionId'),'/resourcegroups/', parameters('serverFarmResourceGroup'), '/providers/Microsoft.Web/serverfarms/', parameters('hostingPlanName'))]"
          },
          "dependsOn": [
          "microsoft.insights/components/joytestfuninsight"
          ]
          },
          {
          "type": "microsoft.insights/components",
          "name": "joytestfuninsight",
          "apiVersion": "2015-05-01",
          "location": "eastus",
          "properties": {
          "ApplicationId": "[parameters('name')]",
          "Request_Source": "IbizaWebAppExtensionCreate"
          }
          }
          ]
          }


          My test parameters:



          {
          "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
          "contentVersion": "1.0.0.0",
          "parameters": {
          "name": {
          "value": "joytestfun"
          },
          "storageName": {
          "value": "joystoragev1"
          },
          "hostingPlanName": {
          "value": "joyplan"
          },
          "location": {
          "value": "Central US"
          },
          "serverFarmResourceGroup": {
          "value": "joywebapp"
          },
          "subscriptionId": {
          "value": "xxxxxxxxxxxxxxxxxxxx"
          }
          }
          }


          Update:



          If you want to create a Function App with a consumption plan, you could refer to the template below.



          Sample:



          {
          "$schema": "http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json#",
          "contentVersion": "1.0.0.0",
          "parameters": {
          "name": {
          "type": "String"
          },
          "storageName": {
          "type": "String"
          },
          "location": {
          "type": "String"
          },
          "subscriptionId": {
          "type": "String"
          }
          },
          "resources": [
          {
          "type": "Microsoft.Web/sites",
          "kind": "functionapp",
          "name": "[parameters('name')]",
          "apiVersion": "2016-03-01",
          "location": "Central US",
          "properties": {
          "siteConfig": {
          "appSettings": [
          {
          "name": "FUNCTIONS_WORKER_RUNTIME",
          "value": "dotnet"
          },
          {
          "name": "AzureWebJobsStorage",
          "value": "[concat('DefaultEndpointsProtocol=https;AccountName=',parameters('storageName'),';AccountKey=',listKeys(resourceId('b83c1ed3-xxxxxxxxxxx-2b83a074c23f','joywebapp','Microsoft.Storage/storageAccounts', parameters('storageName')), '2015-05-01-preview').key1)]"
          },
          {
          "name": "FUNCTIONS_EXTENSION_VERSION",
          "value": "~2"
          },
          {
          "name": "WEBSITE_CONTENTAZUREFILECONNECTIONSTRING",
          "value": "[concat('DefaultEndpointsProtocol=https;AccountName=',parameters('storageName'),';AccountKey=',listKeys(resourceId('b83c1ed3-xxxxxxxxxxx-2b83a074c23f','joywebapp','Microsoft.Storage/storageAccounts', parameters('storageName')), '2015-05-01-preview').key1)]"
          },
          {
          "name": "WEBSITE_CONTENTSHARE",
          "value": "[concat(toLower(parameters('name')), 'b32d')]"
          },
          {
          "name": "WEBSITE_NODE_DEFAULT_VERSION",
          "value": "8.11.1"
          },
          {
          "name": "APPINSIGHTS_INSTRUMENTATIONKEY",
          "value": "[reference('microsoft.insights/components/joytest11insight', '2015-05-01').InstrumentationKey]"
          }
          ]
          },
          "name": "[parameters('name')]",
          "clientAffinityEnabled": false,
          "reserved": false
          },
          "dependsOn": [
          "microsoft.insights/components/joytest11insight"
          ]
          },
          {
          "type": "microsoft.insights/components",
          "name": "joytest11insight",
          "apiVersion": "2015-05-01",
          "location": "eastus",
          "properties": {
          "ApplicationId": "[parameters('name')]",
          "Request_Source": "IbizaWebAppExtensionCreate"
          }
          }
          ]
          }


          My test parameters:



          {
          "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
          "contentVersion": "1.0.0.0",
          "parameters": {
          "name": {
          "value": "joytest11"
          },
          "storageName": {
          "value": "joystoragev1"
          },
          "location": {
          "value": "central us"
          },
          "subscriptionId": {
          "value": "b83c1ed3-xxxxxxxxxxx-2b83a074c23f"
          }
          }
          }





          share|improve this answer















          You may miss the serverFarmId in your template. Try the template below, it will not create a separate app service plan, in my sample, it attaches the Function App to the existing app service plan joyplan and storage account joystoragev1, creates app insight joytestfuninsight and attaches to it.



          Sample:



          {
          "$schema": "http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json#",
          "contentVersion": "1.0.0.0",
          "parameters": {
          "name": {
          "type": "String"
          },
          "storageName": {
          "type": "String"
          },
          "hostingPlanName": {
          "type": "String"
          },
          "location": {
          "type": "String"
          },
          "serverFarmResourceGroup": {
          "type": "String"
          },
          "subscriptionId": {
          "type": "String"
          }
          },
          "resources": [
          {
          "type": "Microsoft.Web/sites",
          "kind": "functionapp",
          "name": "[parameters('name')]",
          "apiVersion": "2016-03-01",
          "location": "[parameters('location')]",
          "properties": {
          "siteConfig": {
          "appSettings": [
          {
          "name": "FUNCTIONS_WORKER_RUNTIME",
          "value": "dotnet"
          },
          {
          "name": "AzureWebJobsStorage",
          "value": "[concat('DefaultEndpointsProtocol=https;AccountName=',parameters('storageName'),';AccountKey=',listKeys(resourceId('b83c1ed3-c5b6-44fb-b5ba-2b83a074c23f','joywebapp','Microsoft.Storage/storageAccounts', parameters('storageName')), '2015-05-01-preview').key1)]"
          },
          {
          "name": "FUNCTIONS_EXTENSION_VERSION",
          "value": "~2"
          },
          {
          "name": "WEBSITE_NODE_DEFAULT_VERSION",
          "value": "8.11.1"
          },
          {
          "name": "APPINSIGHTS_INSTRUMENTATIONKEY",
          "value": "[reference('microsoft.insights/components/joytestfuninsight', '2015-05-01').InstrumentationKey]"
          }
          ],
          "alwaysOn": true
          },
          "name": "[parameters('name')]",
          "clientAffinityEnabled": false,
          "serverFarmId": "[concat('/subscriptions/', parameters('subscriptionId'),'/resourcegroups/', parameters('serverFarmResourceGroup'), '/providers/Microsoft.Web/serverfarms/', parameters('hostingPlanName'))]"
          },
          "dependsOn": [
          "microsoft.insights/components/joytestfuninsight"
          ]
          },
          {
          "type": "microsoft.insights/components",
          "name": "joytestfuninsight",
          "apiVersion": "2015-05-01",
          "location": "eastus",
          "properties": {
          "ApplicationId": "[parameters('name')]",
          "Request_Source": "IbizaWebAppExtensionCreate"
          }
          }
          ]
          }


          My test parameters:



          {
          "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
          "contentVersion": "1.0.0.0",
          "parameters": {
          "name": {
          "value": "joytestfun"
          },
          "storageName": {
          "value": "joystoragev1"
          },
          "hostingPlanName": {
          "value": "joyplan"
          },
          "location": {
          "value": "Central US"
          },
          "serverFarmResourceGroup": {
          "value": "joywebapp"
          },
          "subscriptionId": {
          "value": "xxxxxxxxxxxxxxxxxxxx"
          }
          }
          }


          Update:



          If you want to create a Function App with a consumption plan, you could refer to the template below.



          Sample:



          {
          "$schema": "http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json#",
          "contentVersion": "1.0.0.0",
          "parameters": {
          "name": {
          "type": "String"
          },
          "storageName": {
          "type": "String"
          },
          "location": {
          "type": "String"
          },
          "subscriptionId": {
          "type": "String"
          }
          },
          "resources": [
          {
          "type": "Microsoft.Web/sites",
          "kind": "functionapp",
          "name": "[parameters('name')]",
          "apiVersion": "2016-03-01",
          "location": "Central US",
          "properties": {
          "siteConfig": {
          "appSettings": [
          {
          "name": "FUNCTIONS_WORKER_RUNTIME",
          "value": "dotnet"
          },
          {
          "name": "AzureWebJobsStorage",
          "value": "[concat('DefaultEndpointsProtocol=https;AccountName=',parameters('storageName'),';AccountKey=',listKeys(resourceId('b83c1ed3-xxxxxxxxxxx-2b83a074c23f','joywebapp','Microsoft.Storage/storageAccounts', parameters('storageName')), '2015-05-01-preview').key1)]"
          },
          {
          "name": "FUNCTIONS_EXTENSION_VERSION",
          "value": "~2"
          },
          {
          "name": "WEBSITE_CONTENTAZUREFILECONNECTIONSTRING",
          "value": "[concat('DefaultEndpointsProtocol=https;AccountName=',parameters('storageName'),';AccountKey=',listKeys(resourceId('b83c1ed3-xxxxxxxxxxx-2b83a074c23f','joywebapp','Microsoft.Storage/storageAccounts', parameters('storageName')), '2015-05-01-preview').key1)]"
          },
          {
          "name": "WEBSITE_CONTENTSHARE",
          "value": "[concat(toLower(parameters('name')), 'b32d')]"
          },
          {
          "name": "WEBSITE_NODE_DEFAULT_VERSION",
          "value": "8.11.1"
          },
          {
          "name": "APPINSIGHTS_INSTRUMENTATIONKEY",
          "value": "[reference('microsoft.insights/components/joytest11insight', '2015-05-01').InstrumentationKey]"
          }
          ]
          },
          "name": "[parameters('name')]",
          "clientAffinityEnabled": false,
          "reserved": false
          },
          "dependsOn": [
          "microsoft.insights/components/joytest11insight"
          ]
          },
          {
          "type": "microsoft.insights/components",
          "name": "joytest11insight",
          "apiVersion": "2015-05-01",
          "location": "eastus",
          "properties": {
          "ApplicationId": "[parameters('name')]",
          "Request_Source": "IbizaWebAppExtensionCreate"
          }
          }
          ]
          }


          My test parameters:



          {
          "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
          "contentVersion": "1.0.0.0",
          "parameters": {
          "name": {
          "value": "joytest11"
          },
          "storageName": {
          "value": "joystoragev1"
          },
          "location": {
          "value": "central us"
          },
          "subscriptionId": {
          "value": "b83c1ed3-xxxxxxxxxxx-2b83a074c23f"
          }
          }
          }






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Jan 3 at 2:02

























          answered Jan 2 at 1:29









          Joy WangJoy Wang

          7,7792314




          7,7792314













          • again, there's no need at all for an app service plan. i'm not sure why it's only enforced through ARM template, and not when you deploying from vs

            – l--''''''---------''''''''''''
            Jan 2 at 1:47











          • @l--''''''---------'''''''''''' The function must have a service plan or consumption plan, you could check your function created from vs in the portal, does it have a consumption plan?

            – Joy Wang
            Jan 2 at 1:55











          • yes it does have a consumption plan

            – l--''''''---------''''''''''''
            Jan 2 at 15:54











          • i suppose the question is, how do you get it to do a consumption plan

            – l--''''''---------''''''''''''
            Jan 2 at 15:54











          • @l--''''''---------'''''''''''' If you want to create a Function App with a consumption plan, you could see my update.

            – Joy Wang
            Jan 3 at 2:03



















          • again, there's no need at all for an app service plan. i'm not sure why it's only enforced through ARM template, and not when you deploying from vs

            – l--''''''---------''''''''''''
            Jan 2 at 1:47











          • @l--''''''---------'''''''''''' The function must have a service plan or consumption plan, you could check your function created from vs in the portal, does it have a consumption plan?

            – Joy Wang
            Jan 2 at 1:55











          • yes it does have a consumption plan

            – l--''''''---------''''''''''''
            Jan 2 at 15:54











          • i suppose the question is, how do you get it to do a consumption plan

            – l--''''''---------''''''''''''
            Jan 2 at 15:54











          • @l--''''''---------'''''''''''' If you want to create a Function App with a consumption plan, you could see my update.

            – Joy Wang
            Jan 3 at 2:03

















          again, there's no need at all for an app service plan. i'm not sure why it's only enforced through ARM template, and not when you deploying from vs

          – l--''''''---------''''''''''''
          Jan 2 at 1:47





          again, there's no need at all for an app service plan. i'm not sure why it's only enforced through ARM template, and not when you deploying from vs

          – l--''''''---------''''''''''''
          Jan 2 at 1:47













          @l--''''''---------'''''''''''' The function must have a service plan or consumption plan, you could check your function created from vs in the portal, does it have a consumption plan?

          – Joy Wang
          Jan 2 at 1:55





          @l--''''''---------'''''''''''' The function must have a service plan or consumption plan, you could check your function created from vs in the portal, does it have a consumption plan?

          – Joy Wang
          Jan 2 at 1:55













          yes it does have a consumption plan

          – l--''''''---------''''''''''''
          Jan 2 at 15:54





          yes it does have a consumption plan

          – l--''''''---------''''''''''''
          Jan 2 at 15:54













          i suppose the question is, how do you get it to do a consumption plan

          – l--''''''---------''''''''''''
          Jan 2 at 15:54





          i suppose the question is, how do you get it to do a consumption plan

          – l--''''''---------''''''''''''
          Jan 2 at 15:54













          @l--''''''---------'''''''''''' If you want to create a Function App with a consumption plan, you could see my update.

          – Joy Wang
          Jan 3 at 2:03





          @l--''''''---------'''''''''''' If you want to create a Function App with a consumption plan, you could see my update.

          – Joy Wang
          Jan 3 at 2:03













          0














          Azure Function requires app service plan to operate, so you cant really create Azure Function without one.



          You can attach new Azure Function to already existing App Service plan, thats about it.






          share|improve this answer
























          • im not sure if that's true. if you create an azure function in visual studio and right click --> deploy , it will create that function without having to create a service plan for it

            – l--''''''---------''''''''''''
            Jan 1 at 19:26











          • hm, weird, it appears it definitely doesnt create app service plan on consumption anymore... mhm, never mind, it just doesnt appear instantly, its there. docs.microsoft.com/en-us/azure/azure-functions/functions-scale

            – 4c74356b41
            Jan 1 at 19:43


















          0














          Azure Function requires app service plan to operate, so you cant really create Azure Function without one.



          You can attach new Azure Function to already existing App Service plan, thats about it.






          share|improve this answer
























          • im not sure if that's true. if you create an azure function in visual studio and right click --> deploy , it will create that function without having to create a service plan for it

            – l--''''''---------''''''''''''
            Jan 1 at 19:26











          • hm, weird, it appears it definitely doesnt create app service plan on consumption anymore... mhm, never mind, it just doesnt appear instantly, its there. docs.microsoft.com/en-us/azure/azure-functions/functions-scale

            – 4c74356b41
            Jan 1 at 19:43
















          0












          0








          0







          Azure Function requires app service plan to operate, so you cant really create Azure Function without one.



          You can attach new Azure Function to already existing App Service plan, thats about it.






          share|improve this answer













          Azure Function requires app service plan to operate, so you cant really create Azure Function without one.



          You can attach new Azure Function to already existing App Service plan, thats about it.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Jan 1 at 19:22









          4c74356b414c74356b41

          31.2k42456




          31.2k42456













          • im not sure if that's true. if you create an azure function in visual studio and right click --> deploy , it will create that function without having to create a service plan for it

            – l--''''''---------''''''''''''
            Jan 1 at 19:26











          • hm, weird, it appears it definitely doesnt create app service plan on consumption anymore... mhm, never mind, it just doesnt appear instantly, its there. docs.microsoft.com/en-us/azure/azure-functions/functions-scale

            – 4c74356b41
            Jan 1 at 19:43





















          • im not sure if that's true. if you create an azure function in visual studio and right click --> deploy , it will create that function without having to create a service plan for it

            – l--''''''---------''''''''''''
            Jan 1 at 19:26











          • hm, weird, it appears it definitely doesnt create app service plan on consumption anymore... mhm, never mind, it just doesnt appear instantly, its there. docs.microsoft.com/en-us/azure/azure-functions/functions-scale

            – 4c74356b41
            Jan 1 at 19:43



















          im not sure if that's true. if you create an azure function in visual studio and right click --> deploy , it will create that function without having to create a service plan for it

          – l--''''''---------''''''''''''
          Jan 1 at 19:26





          im not sure if that's true. if you create an azure function in visual studio and right click --> deploy , it will create that function without having to create a service plan for it

          – l--''''''---------''''''''''''
          Jan 1 at 19:26













          hm, weird, it appears it definitely doesnt create app service plan on consumption anymore... mhm, never mind, it just doesnt appear instantly, its there. docs.microsoft.com/en-us/azure/azure-functions/functions-scale

          – 4c74356b41
          Jan 1 at 19:43







          hm, weird, it appears it definitely doesnt create app service plan on consumption anymore... mhm, never mind, it just doesnt appear instantly, its there. docs.microsoft.com/en-us/azure/azure-functions/functions-scale

          – 4c74356b41
          Jan 1 at 19:43




















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53998174%2fwhy-does-an-arm-template-create-a-separate-app-service-plan%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          MongoDB - Not Authorized To Execute Command

          How to fix TextFormField cause rebuild widget in Flutter

          Npm cannot find a required file even through it is in the searched directory