GitHub Action Deployment Error for Azure Functions App

Abdullah Sarfaraz 0 Reputation points
2025-04-14T11:11:12.7866667+00:00

Continuous deployment from a GitHub Action for an Azure Functions App is failing with the following error message:

When request Azure resource at PublishContent, Sync Trigger Functionapp : Failed to perform sync trigger on function app. Function app may have malformed content. Please manually restart your function app and inspect the package from WEBSITE_RUN_FROM_PACKAGE.

The GitHub Action uses the following configuration:

- name: Azure/functions-action@v1
  with:
    app-name: GBHRCopilot
    package: functionapp.zip
    respect-pom-xml: false
    respect-funcignore: false
    scm-do-build-during-deployment: false
    enable-oryx-build: false
    remote-build: false
  env:
    pythonLocation: /opt/hostedtoolcache/Python/3.12.9/x64
    PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.12.9/x64/lib/pkgconfig
    Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.12.9/x64
    Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.12.9/x64
    Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.12.9/x64
    LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.12.9/x64/lib

Additional logs indicate:

  • Using RBAC for authentication, GitHub Action will perform resource validation.
  • Successfully acquired site configs from function app.
  • Detected function app SKU: Consumption.
  • Detected function app language: Python.
  • Will directly deploy functionapp.zip as function app content.
  • Error encountered: Execution Exception (state: PublishContent) (step: Invocation)

What steps can be taken to troubleshoot and resolve this deployment issue?

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,929 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Ranashekar Guda 2,825 Reputation points Microsoft External Staff Moderator
    2025-04-15T14:48:15.2833333+00:00

    Hello @Abdullah Sarfaraz,

    To troubleshoot and resolve the deployment issue with your Azure Functions App using GitHub Actions, consider the following steps:

    • The error message suggests that the function app may have malformed content. Inspect the contents of functionapp.zip to ensure that all necessary files are included and correctly structured for Azure Functions.
    • As indicated in the error message, manually restart your function app in the Azure portal. This can sometimes resolve transient issues.
    • Check the WEBSITE_RUN_FROM_PACKAGE setting in the Azure portal. Ensure that it is correctly configured to point to your deployment package.
    • Ensure that the parameters in your GitHub Action configuration are correct. For instance, if you are using Python, verify that the respect-pom-xml and respect-funcignore parameters are set according.
    • Since you are using Python, ensure that the build options are appropriate for your application. You might want to set remote-build to true to enable a build action from Kudu, which can help in resolving dependencies.

    For further clarification, please refer to the following documentation.

    I hope this helps resolve your issue. Feel free to reach out if you have further concerns.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.