azure-tools-for-intellij icon indicating copy to clipboard operation
azure-tools-for-intellij copied to clipboard

Azure Function deployment fails with WEBSITE_RUN_FROM_PACKAGE setting

Open vjraitila opened this issue 1 year ago • 5 comments

The Rider plugin fails to deploy to a Function App configured to use WEBSITE_RUN_FROM_PACKAGE. This setting is the default for e.g. the Azure Functions extension within VS Code.

STEPS TO REPRODUCE

  1. Provision a Function App in Azure (Consumption, .NET 6, Linux)
  2. Generate a (Azure Functions) project within VS Code with an HttpTrigger
  3. Deploy the project from VS Code
  4. Open the same project in Rider
  5. Attempt to deploy the project from Rider

EXPECTED RESULTS

The project is successfully deployed.

ACTUAL RESULTS

Rider fails to deploy with a non-helpful error message.

...
Publishing ZIP file. Attempt 1 of 3...
Publishing ZIP file. Attempt 2 of 3...
Publishing ZIP file. Attempt 3 of 3...
Fail publishing ZIP file. Response code: 409. Response message: Conflict.
Fail publishing ZIP file: java.lang.RuntimeException: Fail publishing ZIP file. Response code: 409. Response message: Conflict.
Fail publishing ZIP file

vjraitila avatar Sep 16 '23 12:09 vjraitila

The API unfortunately does not give anything more than a 409 Conflict message, which can be for various reasons.

Can you just deploy from Rider without the WEBSITE_RUN_FROM_PACKAGE setting?

maartenba avatar Sep 16 '23 13:09 maartenba

If I drop the WEBSITE_RUN_FROM_PACKAGE setting from app configuration, and clean up the function-releases container from the storage account, the deployment from Rider will obviously succeed.

But what if I want to run the function app from a package?

vjraitila avatar Sep 16 '23 14:09 vjraitila

Rider uses zip deployment, other options are not supported

maartenba avatar Sep 16 '23 20:09 maartenba

They are not mutually exclusive. Having an app run from a package still relies on zip deploy.

vjraitila avatar Sep 17 '23 05:09 vjraitila

Encountered similar issue with (almost) same conditions. When deploying to Azure functions on Linux (.net 8), consumer plan, rider deployment stops the functions app - which, in turn, results in "broken-pipe" error during deployment. Verbose output from AZ CLI deployment indicates that a related sub-tool reports error 401 during deployment - might be caused by same whacky error code. Build #RD-241.14494.325, built on April 16, 2024 And one more thing - AZ CLI docs indicate, that linux/consumption are "special" - they don't have kudu, so the deployment package path must be configured after deployment (https://github.com/MicrosoftDocs/azure-docs/blob/main/articles/azure-functions/run-functions-from-deployment-package.md#benefits-of-running-from-a-package-file , see the consumption/os table) - hopefuly could be useful to fixing the issue

rgxsjurgis avatar Jun 03 '24 13:06 rgxsjurgis