question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to deploy functions (Python 3.9 Linux Consumption Plan)

See original GitHub issue

Hello. We have issues deploying from GitHub Actions with this runner. Python 3.9 Linux Consumption Plan.

When we run func azure functionapp publish alzvendingmachinedev --python locally we are able to successfully deploy and see 5 functions on the Portal within the Function App.

However, when we deploy with this runner (latest v1.4.7) all functions get deleted and never reappear. The API call goes from working, to 404 Not Found and Application Insights shows OperationNotFound exceptions. When we redeploy locally the same API call works once again, and the 5 functions reappear on the portal.

The question is why the runner seemingly deletes all the functions without a sign of failure? Need help debugging. I tried both RBAC and PublishProfile, the end-result is the same.

Here are logs that don’t say much, unfortunately. Is there a way to have them more verbose?

Run Azure/functions-action@v1.4.7
  with:
    app-name: alzvendingmachinedev
    package: ./
    respect-pom-xml: false
    respect-funcignore: false
    scm-do-build-during-deployment: false
    enable-oryx-build: false
  env:
    AZURE_HTTP_USER_AGENT: 
    AZUREPS_HOST_ENVIRONMENT: 
    pythonLocation: /opt/hostedtoolcache/Python/3.9.13/x64
    PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.9.13/x64/lib/pkgconfig
    Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.9.13/x64
    Python[2](https://github.com/REDACTED/PROJECT/runs/7877954211?check_suite_focus=true#step:6:2)_ROOT_DIR: /opt/hostedtoolcache/Python/[3](https://github.com/REDACTED/PROJECT/runs/7877954211?check_suite_focus=true#step:6:3).9.13/x6[4](https://github.com/REDACTED/PROJECT/runs/7877954211?check_suite_focus=true#step:6:4)
    Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.9.13/x[6](https://github.com/REDACTED/PROJECT/runs/7877954211?check_suite_focus=true#step:6:6)4
    LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.9.13/x64/lib
Using RBAC for authentication, GitHub Action will perform resource validation.
Successfully acquired site configs from function app!
Detected function app sku: Consumption
Successfully acquired app settings from function app (RBAC)!
Detected function app language: Python
Will archive ./ into /home/runner/work/_temp/temp_web_package_[7](https://github.com/REDACTED/PROJECT/runs/7877954211?check_suite_focus=true#step:6:7)70662064[8](https://github.com/REDACTED/PROJECT/runs/7877954211?check_suite_focus=true#step:6:8)[9](https://github.com/REDACTED/PROJECT/runs/7877954211?check_suite_focus=true#step:6:9)00389.zip as function app content
Will use WEBSITE_RUN_FROM_PACKAGE to deploy since RBAC is detected and your function app is on Linux Consumption.
Sync Trigger call was successful.

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:14

github_iconTop GitHub Comments

4reactions
imduchycommented, Sep 19, 2022

@patelchandni thanks for the tip. We’ve found the problem.

As we’re hosting our code in a monorepo, we are specifying dynamic defaults.run.working-directory per Azure Function/application. We assumed that the package argument in Azure/functions-action is automatically picking that up but it seems like it doesn’t.

After changing the value of the package argument from . to ./path-to/function, everything started to work as expected.

jobs:
  build-deploy:
    defaults:
      run:
        working-directory: "path-to/function" 

    - name: 'Run Azure Functions Action'
      uses: Azure/functions-action@v1.4.7
      with:
        app-name: ${{ inputs.azure_functionapp_name }}
        package: '.' # The package argument didn't consider "defaults.run.working-directory"
        publish-profile: ${{ secrets.PUBLISH_PROFILE_DEV }}
        scm-do-build-during-deployment: true
        enable-oryx-build: true

Is that intended behavior?

2reactions
binaryPUNCHcommented, Aug 22, 2022

Still struggling. Any ideas from anyone?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error while deploying Python Function to Function App using ...
Hello, I'm experiencing issues while deploying python Function (using VS Code) to "premade" Function App (Created using Azure Portal).
Read more >
Unable to deploy basic example HttpRequest1 to Azure ...
I ran into this problem and ran this manually: func azure functionapp publish <AZURE_FUNCTION_NAME_GOES_HERE> --build remote.
Read more >
Python Azure function can't load pyodbc under Linux #827
I built an Azure function in Python that I'm deploying to a Linux function app (consumption type). I use the standard Azure Devops...
Read more >
Developing and deploying a Python Azure Function - Medium
A consumption function app plan on DEV; A premium function app plan on UAT and PROD. How would you code deploy.ps1 to handle...
Read more >
Can I create a CI/CD pipeline to deploy Python Function to ...
Yes, you can use Windows self-hosted Azure DevOps agent to deploy Python function to the Linux based Azure Function App; and, No, you...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found