Closed ashwinvenkatesha closed 1 month ago
Thank you for reporting - I have just fixed the issue with the storage container create. Please pull the latest from the repo and try again, let me know if you still get errors.
Note that Flex Consumption has a new section where the storage container to use for the deployment package, as well as the app runtime and scaling settings are configured, you need to ensure this section exists: https://github.com/Azure-Samples/azure-functions-flex-consumption-samples/blob/b8eb32a6e88bd9637ff549c76234b36b6f905951/IaC/armtemplate/azuredeploy.json#L161-L179
I see, thanks. So in case, I have an arm template where I define "type": "Microsoft.Web/sites" for premium and consumption apps, how to ensure the additional section you have listed above gets incorporated? A conditional based section? Here is my arm template: https://github.com/illumio-shield/Azure-Sentinel/blob/Illumio-Integration-GA-branch/Solutions/IllumioSaaS/Data%20Connectors/azuredeploy_IllumioSaaS_FunctionApp.json#L811
Yes - for the hosting plan ('serverfarm') you can reuse it the section, but for the Microsoft.Web/sites there's enough differences that warrants a conditional based switch between the plans.
Here's one way we did it with Bicep for example, with different modules being called depending on the value of the azFunctionHostingPlanType parameter: https://github.com/Azure-Samples/Azure-Functions-OpenAI-Demo/blob/7dfa6ea002ee165b5bee1b29f9d3f17797517c57/infra/main.bicep#L167-L209
@ashwinvenkatesha - OK if I close this issue?
Closing this issue - please create a new one if the replies haven't addressed it.
Attempting to deploy this template https://github.com/Azure-Samples/azure-functions-flex-consumption-samples/blob/main/IaC/armtemplate/azuredeploy.json
Any log messages given by the failure
Second issue: i tried to deploy a custom template that attempts to create flex consumption function app, that failed with {"code":"BadRequest","message":"Site.FunctionAppConfig is invalid. The FunctionAppConfig section was not specified in the request, which is required for Flex Consumption sites. To proceed, please add the FunctionAppConfig section in your request.","details":[{"message":"Site.FunctionAppConfig is invalid. The FunctionAppConfig section was not specified in the request, which is required for Flex Consumption sites. To proceed, please add the FunctionAppConfig section in your request."},{"code":"BadRequest"},{}]} Here is the template I am using
{ "type": "Microsoft.Web/serverfarms", "apiVersion": "2023-12-01", "name": "[variables('functionName')]", "location": "[variables('logAnalyticsWorkspaceLocation')]", "tags": "[ if(contains(variables('tagsByResource'), 'Microsoft.Web/serverfarms'), variables('tagsByResource')['Microsoft.Web/serverfarms'], json('{}')) ]", "sku": { "tier": "FlexConsumption", "name": "FC1" }, "kind": "functionapp", "properties": { "reserved": true }, "condition": "[equals(variables('functionAppHostingPlan'),'flex')]" },
Expected/desired behavior
Mention any other details that might be useful
I chose to deploy a python flex function app in log analytics workspace