Azure / Azure-Functions

1.12k stars 198 forks source link

Pipelines Fail Deploying Dotnet Isolated Linux Function App (Consumption) #2326

Open Jordan-Murray opened 1 year ago

Jordan-Murray commented 1 year ago

Hi there.

Issue - Intermitant Deploying of Donet Isolated Linux Function App (Consumption)

We're trying to use Azure Pipelines to publish and deploy a Function App to Azure.

Our YAML pipeline is correct as it's worked in many other cases. The error we get can be seen in the screenshot below PipelineFail

Occasionally the pipeline would succeed, without changing anything, however, the functions would not actually be loaded if you looked in the Function App in the Azure Portal nor callable via Postman.

Publishing via Visual Studio would also intermittently work, sometimes succeeding, sometimes failing because of a ZipDeploy error. However, when the VS publishing occasionally worked, it would deploy and publish correctly, with all functions showing up in Azure and targetable. StackTrace

The only workaround we've found is to use a Windows function app instead of Linux.

Function App Configuration

SCM_DO_BUILD_DURING_DEPLOYMENT - 0 FUNCTIONS_WORKER_RUNTIME - dotnet-isolated

tomaustin700 commented 1 year ago

I can also duplicate this easily. Simply create a dotnet-isolated Linux function within a consumption plan, create a brand new function using visual studio and then try and deploy using a ADO pipeline and I get the exact same issue. Can provide access to repo/pipelines if required.

tomaustin700 commented 1 year ago

This issue suggests that it's not possible to do a zip deployment to a Linux consumption plan function: https://github.com/microsoft/azure-pipelines-tasks/issues/13885

It's also documented here: https://learn.microsoft.com/en-us/azure/azure-functions/functions-deployment-technologies#external-package-url under External Package Url.

It would be good if the error produced mentions that this is a problem, does this need addressing in the AzureFunctionApp Azure DevOps task?

bhagyshricompany commented 1 year ago

Yes, it appears that zip deployment is not currently supported for Linux consumption plan functions, as noted in the issue you linked and in the documentation you provided. This limitation is likely due to the way that Linux consumption plan functions are designed and managed, which may not be compatible with the zip deployment process.

It would be helpful if the error message produced by the Azure Function App Azure DevOps task more clearly communicated this limitation, rather than implying that there is a problem with the deployment itself. If you would like to see this addressed, you can submit a feature request or suggestion to the Azure DevOps team through the Azure DevOps Developer Community or the Azure DevOps UserVoice forum.

bhagyshricompany commented 1 year ago

@patelchandni confirm your comment and validate

bhagyshricompany commented 1 year ago

@fabiocav pls confirm and validate

rf-0 commented 1 year ago

Yes, it appears that zip deployment is not currently supported for Linux consumption plan functions, as noted in the issue you linked and in the documentation you provided. This limitation is likely due to the way that Linux consumption plan functions are designed and managed, which may not be compatible with the zip deployment process.

It would be helpful if the error message produced by the Azure Function App Azure DevOps task more clearly communicated this limitation, rather than implying that there is a problem with the deployment itself. If you would like to see this addressed, you can submit a feature request or suggestion to the Azure DevOps team through the Azure DevOps Developer Community or the Azure DevOps UserVoice forum.

Docs say otherwise. https://learn.microsoft.com/en-us/azure/azure-functions/functions-deployment-technologies?tabs=windows#deployment-technology-availability

fabge commented 3 months ago

any updates here? there seems to be a mismatch in the documentation between what @tomaustin700 and @rf-0 posted...