CopyPastor

Detecting plagiarism made easy.

Score: 0.8232933878898621; Reported for: String similarity Open both answers

Possible Plagiarism

Plagiarized on 2019-07-16
by Joey Cai

Original Post

Original - Posted on 2019-03-22
by KetanChawda-MSFT



            
Present in both answers; Present only in the new answer; Present only in the old answer;

>why I do not have the option to choose the Consumption plan?
When we create an Azure Function App from Azure Portal on a Consumption plan we don’t have the control over which Consumption plan to use.
>how can I create a Function app that uses the Consumption plan?
You can create a Azure Function on Consumption plan with your choice of name for consumption plan using ARM Template. Below is the [sample template][1] and parameter file:
{ "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "parameters": { "appName": { "type": "string", "metadata": { "description": "The name of the function app that you wish to create." } }, "hostingPlanName": { "type": "string", "metadata": { "description": "The name of the function app consumption plan that you wish to create." } }, "storageAccountType": { "type": "string", "defaultValue": "Standard_LRS", "allowedValues": ["Standard_LRS", "Standard_GRS", "Standard_RAGRS"], "metadata": { "description": "Storage Account type" } }, "location": { "type": "string", "defaultValue": "[resourceGroup().location]", "metadata": { "description": "Location for all resources." } }, "runtime": { "type": "string", "defaultValue": "node", "allowedValues": ["node", "dotnet", "java"], "metadata": { "description": "The language worker runtime to load in the function app." } } }, "variables": { "functionAppName": "[parameters('appName')]", "hostingPlanName": "[parameters('appName')]", "applicationInsightsName": "[parameters('appName')]", "storageAccountName": "[concat(uniquestring(resourceGroup().id), 'azfunctions')]", "storageAccountid": "[concat(resourceGroup().id,'/providers/','Microsoft.Storage/storageAccounts/', variables('storageAccountName'))]", "functionWorkerRuntime": "[parameters('runtime')]" }, "resources": [ { "type": "Microsoft.Storage/storageAccounts", "name": "[variables('storageAccountName')]", "apiVersion": "2016-12-01", "location": "[parameters('location')]", "kind": "Storage", "sku": { "name": "[parameters('storageAccountType')]" } }, { "type": "Microsoft.Web/serverfarms", "apiVersion": "2015-04-01", "name": "[variables('hostingPlanName')]", "location": "[parameters('location')]", "properties": { "name": "[variables('hostingPlanName')]", "computeMode": "Dynamic", "sku": "Dynamic" } }, { "apiVersion": "2015-08-01", "type": "Microsoft.Web/sites", "name": "[variables('functionAppName')]", "location": "[parameters('location')]", "kind": "functionapp", "dependsOn": [ "[resourceId('Microsoft.Web/serverfarms', variables('hostingPlanName'))]", "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]" ], "properties": { "serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('hostingPlanName'))]", "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": "~2" }, { "name": "WEBSITE_NODE_DEFAULT_VERSION", "value": "8.11.1" }, { "name": "APPINSIGHTS_INSTRUMENTATIONKEY", "value": "[reference(resourceId('microsoft.insights/components/', variables('applicationInsightsName')), '2015-05-01').InstrumentationKey]" }, { "name": "FUNCTIONS_WORKER_RUNTIME", "value": "[variables('functionWorkerRuntime')]" } ] } } }, { "apiVersion": "2018-05-01-preview", "name": "[variables('applicationInsightsName')]", "type": "microsoft.insights/components", "location": "East US", "tags": { "[concat('hidden-link:', resourceGroup().id, '/providers/Microsoft.Web/sites/', variables('applicationInsightsName'))]": "Resource" }, "properties": { "ApplicationId": "[variables('applicationInsightsName')]", "Request_Source": "IbizaWebAppExtensionCreate" } } ] }

[1]: https://github.com/Azure/azure-quickstart-templates/tree/master/101-function-app-create-dynamic
You can create a Azure Function on Consumption plan with your choice of name for consumption plan using ARM Template. Below is the sample template and parameter file:
**Templatefile.json**
{ "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "parameters": { "appName": { "type": "string", "metadata": { "description": "The name of the function app that you wish to create." } }, "storageAccountType": { "type": "string", "defaultValue": "Standard_LRS", "allowedValues": ["Standard_LRS", "Standard_GRS", "Standard_RAGRS"], "metadata": { "description": "Storage Account type" } }, "location": { "type": "string", "defaultValue": "[resourceGroup().location]", "metadata": { "description": "Location for all resources." } }, "runtime": { "type": "string", "defaultValue": "node", "allowedValues": ["node", "dotnet", "java"], "metadata": { "description": "The language worker runtime to load in the function app." } } }, "variables": { "functionAppName": "[parameters('appName')]", "hostingPlanName": "[parameters('appName')]", "applicationInsightsName": "[parameters('appName')]", "storageAccountName": "[concat(uniquestring(resourceGroup().id), 'azfunctions')]", "storageAccountid": "[concat(resourceGroup().id,'/providers/','Microsoft.Storage/storageAccounts/', variables('storageAccountName'))]", "functionWorkerRuntime": "[parameters('runtime')]" }, "resources": [ { "type": "Microsoft.Storage/storageAccounts", "name": "[variables('storageAccountName')]", "apiVersion": "2016-12-01", "location": "[parameters('location')]", "kind": "Storage", "sku": { "name": "[parameters('storageAccountType')]" } }, { "type": "Microsoft.Web/serverfarms", "apiVersion": "2015-04-01", "name": "[variables('hostingPlanName')]", "location": "[parameters('location')]", "properties": { "name": "[variables('hostingPlanName')]", "computeMode": "Dynamic", "sku": "Dynamic" } }, { "apiVersion": "2015-08-01", "type": "Microsoft.Web/sites", "name": "[variables('functionAppName')]", "location": "[parameters('location')]", "kind": "functionapp", "dependsOn": [ "[resourceId('Microsoft.Web/serverfarms', variables('hostingPlanName'))]", "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]" ], "properties": { "serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('hostingPlanName'))]", "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": "~2" }, { "name": "WEBSITE_NODE_DEFAULT_VERSION", "value": "8.11.1" }, { "name": "APPINSIGHTS_INSTRUMENTATIONKEY", "value": "[reference(resourceId('microsoft.insights/components/', variables('applicationInsightsName')), '2015-05-01').InstrumentationKey]" }, { "name": "FUNCTIONS_WORKER_RUNTIME", "value": "[variables('functionWorkerRuntime')]" } ] } } }, { "apiVersion": "2018-05-01-preview", "name": "[variables('applicationInsightsName')]", "type": "microsoft.insights/components", "location": "East US", "tags": { "[concat('hidden-link:', resourceGroup().id, '/providers/Microsoft.Web/sites/', variables('applicationInsightsName'))]": "Resource" }, "properties": { "ApplicationId": "[variables('applicationInsightsName')]", "Request_Source": "IbizaWebAppExtensionCreate" } } ] }
**Reference:** https://github.com/Azure/azure-quickstart-templates/tree/master/101-function-app-create-dynamic

        
Present in both answers; Present only in the new answer; Present only in the old answer;