Add support for custom handlers in Linux consumption plans
See original GitHub issueWhen I am attempting to deploy using this Action the deployment always fails. The same build can be deployed with the func azure functionapp publish
command without any issue.
There are two different errors based on whether the WEBSITE_RUN_FROM_PACKAGE
configuration option is set or not. We are using a Linux consumption plan, so when set it points to a blob storage containing the latest deployment zip. Obviously this option will be set after the first deployment so it should work in both cases.
Log when WEBSITE_RUN_FROM_PACKAGE is set
Run Azure/functions-action@v1
with:
app-name: func-REDACTED-staging-01
package: ./build
publish-profile: ***
respect-funcignore: true
respect-pom-xml: false
scm-do-build-during-deployment: false
enable-oryx-build: false
Successfully parsed SCM credential from old publish-profile format.
Using SCM credential for authentication, GitHub Action will not perform resource validation.
Sucessfully acquired app settings from function app (with SCM credential)!
Warning: The .funcignore file does not exist in your path ./build. Nothing will be changed.
Warning: The .funcignore file shares the same format as .gitignore. You can use it to exclude files from deployment.
Will archive ./build into /home/runner/work/_temp/temp_web_package_8964073453852144.zip as function app content
Will use Kudu https://<scmsite>/api/zipdeploy to deploy since publish-profile is detected.
Setting SCM_DO_BUILD_DURING_DEPLOYMENT in Kudu container to false
Update using Client.updateAppSettingViaKudu
Response with status code 204
App setting SCM_DO_BUILD_DURING_DEPLOYMENT propagated to Kudu container
Setting ENABLE_ORYX_BUILD in Kudu container to false
Update using Client.updateAppSettingViaKudu
Response with status code 204
App setting ENABLE_ORYX_BUILD propagated to Kudu container
Package deployment using ZIP Deploy initiated.
Error: Failed to deploy web package to App Service.
Successfully updated deployment History at func-REDACTED-staging-01.scm.azurewebsites.net/api/deployments/b5026f1058de8a11fedc3d0ef30729628f1c08011621435576470
Error: Execution Exception (state: PublishContent) (step: Invocation)
Error: When request Azure resource at PublishContent, zipDeploy : Failed to use /home/runner/work/_temp/temp_web_package_8964073453852144.zip as ZipDeploy content
Error: Failed to deploy web package to App Service.
Not Found (CODE: 404)
Error: Error: Failed to deploy web package to App Service.
Not Found (CODE: 404)
at Kudu.<anonymous> (/home/runner/work/_actions/Azure/functions-action/v1/node_modules/azure-actions-appservice-rest/Kudu/azure-app-kudu-service.js:175:23)
at Generator.throw (<anonymous>)
at rejected (/home/runner/work/_actions/Azure/functions-action/v1/node_modules/azure-actions-appservice-rest/Kudu/azure-app-kudu-service.js:6:65)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
Error: Deployment Failed!
Log when WEBSITE_RUN_FROM_PACKAGE is NOT set
Run Azure/functions-action@v1
with:
app-name: func-REDACTED-staging-01
package: ./build
publish-profile: ***
respect-funcignore: true
respect-pom-xml: false
scm-do-build-during-deployment: false
enable-oryx-build: false
Successfully parsed SCM credential from old publish-profile format.
Using SCM credential for authentication, GitHub Action will not perform resource validation.
Sucessfully acquired app settings from function app (with SCM credential)!
Warning: The .funcignore file does not exist in your path ./build. Nothing will be changed.
Warning: The .funcignore file shares the same format as .gitignore. You can use it to exclude files from deployment.
Will archive ./build into /home/runner/work/_temp/temp_web_package_7836364297632616.zip as function app content
Will use Kudu https://<scmsite>/api/zipdeploy to deploy since publish-profile is detected.
Error: Execution Exception (state: PublishContent) (step: Invocation)
Error: When request Azure resource at PublishContent, zipDepoy : WEBSITE_RUN_FROM_PACKAGE in your function app is set to an URL. Please remove WEBSITE_RUN_FROM_PACKAGE app setting from your function app.
Error: Deployment Failed!
The relevant settings from the workflow file:
- name: Deploy
uses: Azure/functions-action@v1
with:
app-name: func-REDACTED-staging-01
package: ./build
publish-profile: ${{ secrets.STAGING_PUBLISH_PROFILE }}
respect-funcignore: true
The structure of my build folder:
func1-v1/
- function.json
- handler.js
func2-v1/
- function.json
- handler.js
shared/
node_modules/
- <all required prod dependencies preinstalled before calling deployment>
host.json
local.settings.json
package.json
package-lock.json
What next steps can we take to solve this issue?
Issue Analytics
- State:
- Created 2 years ago
- Reactions:4
- Comments:23 (5 by maintainers)
Top Results From Across the Web
Azure Functions custom handlers | Microsoft Learn
Custom handlers are lightweight web servers that receive events from the Functions host. Any language that supports HTTP primitives can ...
Read more >How to deploy Azure Functions Custom Handler for R ...
I am trying to understand if I can run an R Custom Handler function in Azure on a Consumption Plan rather than Premium...
Read more >Tip 319 - How to create custom handlers for Azure Functions
Change host.json to point to handler instead of handler.exe. Pick Consumption for the hosting plan; Select a Resource Group for the Function App ......
Read more >php_handler: Custom PHP Handlers | Plesk 12.5 documentation
php_handler: Custom PHP Handlers. The php_handler utility is used to PHP versions, SAPI and php.ini availiable for hosting users (PHP handlers).
Read more >Serverless Go in Azure Functions with custom handlers
Getting started from scratch with Go custom handlers in Azure ... app to an Azure Functions Consumption plan 16:22 Custom handler tips and ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@ss185427 Please try to set
WEBSITE_MOUNT_ENABLED
to0
.Steps to reproduce -
Create an Azure Function in Go using instructions from here.
Deploy on a Linux Consumption plan with Azure Functions Core Tools (via Azure Functions VS Code extension).
Deployment works fine and Function also runs as expected at this point.
Setup deployment using GitHub Actions using functions-action@v1.4.0
Deployment fails from GitHub Actions with message - Please remove WEBSITE_RUN_FROM_PACKAGE app setting from your function app.
Remove WEBSITE_RUN_FROM_PACKAGE from Function App Configuration, the deployment now succeeds in GitHub Actions.
Check Azure Function -