Azure / azure-functions-dotnet-worker

Azure Functions out-of-process .NET language worker
MIT License
422 stars 184 forks source link

Dotnet CLI cannot deploy manual zip packages into a Linux host #2394

Open soonwong opened 6 months ago

soonwong commented 6 months ago

What version of .NET does your existing project use?

.NET 6

What version of .NET are you attempting to target?

.NET 8

Description

I am updating our Azure Function deployment from a Windows based app service plan to a Linux host.

Our standard workflow is to create a publishing package, and then feed that into a CI/CD tool (e.g. Jenkins, Octopus Deploy, etc). i.e.

(in CI tooling)
dotnet publish (create the publish artifacts)
dotnet pack (create a zip-deploy package)
...
(in deploy tooling)
az webapp deploy zipfile.zip

While the files deployed this way get uploaded successfully, Azure Portal reports "No job functions found". This is because the main executable/entrypoint file is not marked with execute permissions.

However, if I publish via Visual Studio, the same code base works and is registered correctly. I've tracked it down to this file https://github.com/Azure/azure-functions-dotnet-worker/blob/main/sdk/Sdk/Tasks/ZipDeploy/ZipDeployTask.cs which is invoked during the Visual Studio deploy.

Is there a way to invoke the same packaging behaviour via the dotnet CLI or msbuild CLIs? As a microsoft centric developer, I feel that a better experience would be for this to be transparent to the developer; having to know nuances like this for the various platforms is not obvious (i.e. the deploy into a linux environment should take care of this, rather than the developer).

I appreciate that this may not be the correct issue area; please feel free to move as needed.

Project configuration and dependencies

No response

Link to a repository that reproduces the issue

No response

satvu commented 5 months ago

Linking this to https://github.com/Azure/azure-functions-host/issues/10021 as well as part of collection of deployment/zip related issues