Azure-Functions icon indicating copy to clipboard operation
Azure-Functions copied to clipboard

Issues deploying Azure Functions using WEBSITE_RUN_FROM_PACKAGE with Flex Consumption Plan

Open ldygonzales opened this issue 1 year ago • 3 comments

Please describe the documentation request or issue. Be as specific as possible. We are trying to deploy an Azure Function using the Flex Consumption Plan and have encountered issues that we have not been able to resolve. Here are the steps we followed:

Created an Azure Function with an HTTP Trigger using C#. Published the function and generated a .zip file containing the function code. Uploaded the .zip file to Azure Blob Storage. The blob URL is: https://scxxxxxxxxxxxx.blob.core.windows.net/app-package-xxx-dev/HttpTriggerCSharp1.zip

Set the WEBSITE_RUN_FROM_PACKAGE app setting to the URL of the blob mentioned above. Restarted the Function App using the Azure portal.

We also tried to sync the function triggers using the following command az: az functionapp deployment source sync --name fnxxxxxxxxx --resource-group rgxxxxxxxxx

Despite all of these steps, the function does not appear to be deployed in the Azure portal, and we do not see any related logs in Application Insights.

In the "System Keys" and "Host Keys" sections of the Azure portal, we see system errors with the message InternalServerError. We have verified that all permissions and configurations are correct, ensuring that the Function App has access to the Blob Storage.

Are there any additional steps we should follow when using WEBSITE_RUN_FROM_PACKAGE with the Flex Consumption Plan? Are there any known issues with this deployment method or any incompatibility with the Flex Consumption Plan? How can we ensure that our function is successfully deployed? We would greatly appreciate any guidance or additional documentation to help resolve this issue.

Regards!

ldygonzales avatar Nov 09 '24 05:11 ldygonzales

Is your blob package available publicly?

I can share this sample with you. The only difference is consumption mode for the Function.

MCKLMT avatar Feb 05 '25 16:02 MCKLMT

AzureFunctionApp@2 is using SAS URL with SharedAccessPermissions.READ permission for WEBSITE_RUN_FROM_PACKAGE see https://github.com/microsoft/azure-pipelines-tasks/blob/6d3db56410d415d9aa836a1eddf9e7b6122a7a21/Tasks/AzureFunctionAppV2/deploymentProvider/ConsumptionWebAppDeploymentProvider.ts#L52

KuSh avatar Mar 14 '25 09:03 KuSh

one year and the completely wrong documentation still exists - what in the world is so hard to updatre the documentation?????!!!!!

this is just wrong https://learn.microsoft.com/en-us/azure/azure-functions/flex-consumption-how-to?tabs=azure-cli%2Cazure-cli-publish&pivots=programming-language-csharp#deploy-your-code-project

ulluoink avatar Nov 28 '25 08:11 ulluoink