Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flex Consumption deployment (Node Azure Functions App) #238

Open
miszu opened this issue Jun 15, 2024 · 5 comments
Open

Flex Consumption deployment (Node Azure Functions App) #238

miszu opened this issue Jun 15, 2024 · 5 comments

Comments

@miszu
Copy link

miszu commented Jun 15, 2024

I see that this PR by @patelchandni #229 adds support for Flex Consumption plan of Azure Functions. I've tried deploying my Node Azure Function app to Flex Consumption with this yml actio:

    - name: 'Run Azure Functions Action'
      uses: Azure/functions-action@v1.5.2
      id: fa
      with:
        app-name: ${{ env.AZURE_FUNCTIONAPP_NAME }}
        package: ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}
        publish-profile: ${{ secrets.AZURE_FUNCTIONAPP_PUBLISH_PROFILE }}
        sku: flexconsumption
        remote-build: true

but this fails with:

Run Azure/functions-action@v1.5.2
  with:
    app-name: fitfunctionsapi
    package: .
    publish-profile: ***
    sku: flexconsumption
    remote-build: true
    respect-pom-xml: false
    respect-funcignore: false
    scm-do-build-during-deployment: false
    enable-oryx-build: false
  env:
    AZURE_FUNCTIONAPP_NAME: fitfunctionsapi
    AZURE_FUNCTIONAPP_PACKAGE_PATH: .
Successfully parsed SCM credential from publish-profile format.
Using SCM credential for authentication, GitHub Action will not perform resource validation.
Successfully acquired app settings from function app (with SCM credential)!
Will archive . into /home/runner/work/_temp/temp_web_package_3544899524961187.zip as function app content
Will use Kudu https://<scmsite>/api/publish to deploy since Flex consumption plan is detected.
Will use parameter remote-build: true
Package deployment using One Deploy initiated.
Starting deployment pipeline.
[ValidationStep] starting.
[AppSettingValidation] starting.
[DeploymentStorageValidation] starting.
Validation completed
[SourcePackageUriDownloadStep] starting.
Zip package is present at /tmp/zipdeploy/787287ed-8789-40f4-9f05-f9e150f41c70.zip
[ExtractZipStep] starting.
Cleaning files in /tmp/zipdeploy/extracted
Extracted zip package in /tmp/zipdeploy/extracted
[OryxBuildStep] starting.
Running oryx build command: oryx build /tmp/zipdeploy/extracted -o /home/site/wwwroot --platform nodejs --platform-version 20.11.1
sh: 1: tsc: Permission denied
sh: 1: tsc: Permission denied\n/opt/Kudu/Scripts/starter.sh oryx build /tmp/zipdeploy/extracted -o /home/site/wwwroot --platform nodejs --platform-version 20.11.1
Failed during oryx build due to sh: 1: tsc: Permission denied\n/opt/Kudu/Scripts/starter.sh oryx build /tmp/zipdeploy/extracted -o /home/site/wwwroot --platform nodejs --platform-version 20.11.1
Deployment failed with Error: sh: 1: tsc: Permission denied\n/opt/Kudu/Scripts/starter.sh oryx build /tmp/zipdeploy/extracted -o /home/site/wwwroot --platform nodejs --platform-version 20.11.1
Error: Failed to deploy web package to Function App.
Error: Execution Exception (state: PublishContent) (step: Invocation)
Error:   When request Azure resource at PublishContent, oneDeploy : Failed to use /home/runner/work/_temp/temp_web_package_3544899524961187.zip as OneDeploy content
Error:     Package deployment using ZIP Deploy failed. Refer logs for more details.
Error: Deployment Failed!

Am I doing something wrong? I'd appreciate any help and would be happy to provide more logs/test solutions :)

@Yvand
Copy link

Yvand commented Jul 2, 2024

I am experiencing exactly the same error, with exactly the same settings in the action.
@miszu did you find a solution?

@miszu
Copy link
Author

miszu commented Jul 2, 2024

I am experiencing exactly the same error, with exactly the same settings in the action. @miszu did you find a solution?

@Yvand unfortunately I did not find a solution and gave up for the time being :(

@Yvand
Copy link

Yvand commented Jul 2, 2024

I checked the deplyment logs on the app service side, and it looks like a dumb warning on a deprecated package causes the failure:

[ // removed irrelevant content
    {
        "log_time": "2024-07-02T13:08:44.7964544Z",
        "id": "335bd5f8-5624-4bf9-823c-5b500503e551",
        "message": "npm WARN deprecated debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)\\nnpm notice \\nnpm notice New minor version of npm available! 10.2.4 -> 10.8.1\\nnpm notice Changelog: <https://github.com/npm/cli/releases/tag/v10.8.1>\\nnpm notice Run `npm install -g npm@10.8.1` to update!\\nnpm notice\\n/opt/Kudu/Scripts/starter.sh oryx build /tmp/zipdeploy/extracted -o /home/site/wwwroot --platform nodejs --platform-version 20.11.1",
        "type": 2
    },
    {
        "log_time": "2024-07-02T13:08:44.7968642Z",
        "id": "335bd5f8-5624-4bf9-823c-5b500503e551",
        "message": "Failed during oryx build due to npm WARN deprecated debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)\\nnpm notice \\nnpm notice New minor version of npm available! 10.2.4 -> 10.8.1\\nnpm notice Changelog: <https://github.com/npm/cli/releases/tag/v10.8.1>\\nnpm notice Run `npm install -g npm@10.8.1` to update!\\nnpm notice\\n/opt/Kudu/Scripts/starter.sh oryx build /tmp/zipdeploy/extracted -o /home/site/wwwroot --platform nodejs --platform-version 20.11.1",
        "type": 2
    },
    {
        "log_time": "2024-07-02T13:08:44.8228944Z",
        "id": "335bd5f8-5624-4bf9-823c-5b500503e551",
        "message": "Deployment failed with Error: npm WARN deprecated debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)\\nnpm notice \\nnpm notice New minor version of npm available! 10.2.4 -> 10.8.1\\nnpm notice Changelog: <https://github.com/npm/cli/releases/tag/v10.8.1>\\nnpm notice Run `npm install -g npm@10.8.1` to update!\\nnpm notice\\n/opt/Kudu/Scripts/starter.sh oryx build /tmp/zipdeploy/extracted -o /home/site/wwwroot --platform nodejs --platform-version 20.11.1",
        "type": 2
    }
]

@patelchandni
Copy link
Collaborator

@miszu and @Yvand - The error occurs during oryx build so, it is not an issue with this GitHub action but some dependency in your package itself is deprecated and so oryx build is failing. Please correct the version is your app.

@Yvand
Copy link

Yvand commented Jul 3, 2024

You are totally right, I can repro the same warning message on my machine if I delete folder node_modules and then run npm install.
Based on the package-lock.json, it is @azure/cosmos 4.0.0 that explicitly depends on debug 4.1.1, hence causing the warning message.

Thank you for your very useful input!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants