Azure / functions-action

Enable GitHub developers to deploy to Azure Function Apps using GitHub Actions
MIT License
157 stars 75 forks source link

Node Functions App Deploy fails - Internal Server Error (CODE: 500) #115

Closed ryanfollmer closed 2 years ago

ryanfollmer commented 2 years ago

Created a new Azure Function App today on Windows using a consumption plan and am using Azure/functions-action@v1 in our GH action to deploy a nodejs app (12.x). The first deploy worked just fine. We were able to test the deployed function and it was working. We are using WEBSITE_RUN_FROM_PACKAGE = 1 in our application settings.

However, any subsequent deployment attempt fails.

image

Deployment Center Logs produce a single entry "failed" that doesn't provide any other detail about why this fails.

GH Action Yaml (pretty much a straight up copy of the example):

env:
  AZURE_FUNCTIONAPP_NAME: LegacyBuildTest    # set this to your application's name
  AZURE_FUNCTIONAPP_PACKAGE_PATH: '.'      # set this to the path to your web app project, defaults to the repository root
  NODE_VERSION: '12.x'                     # set this to the node version to use (supports 8.x, 10.x, 12.x)
  NODE_ENV: development

jobs:
  build-and-deploy:
    runs-on: ubuntu-latest
    steps:
    - name: 'Checkout GitHub Action'
      uses: actions/checkout@master

    - name: Setup Node ${{ env.NODE_VERSION }} Environment
      uses: actions/setup-node@v1
      with:
        node-version: ${{ env.NODE_VERSION }}

    - name: 'Resolve Project Dependencies Using Npm'
      shell: bash
      run: |
        pushd './${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}'
        npm install
        npm run build-prod --if-present
        npm run test --if-present
        popd
    - name: Azure Functions Action
      uses: Azure/functions-action@v1
      with:
        app-name: ${{ env.AZURE_FUNCTIONAPP_NAME }}
        package: ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}
        publish-profile: ${{ secrets.AZURE_FUNCTIONAPP_BUILDTEST_PUBLISH_PROFILE }}

Function App Id: 32a72a36-92de-42aa-971f-c01e91608d8d Operation System: Windows Runtime Version: 3.3.1.0

patelchandni commented 2 years ago

Hi @ryanfollmer, I'm looking into this issue and have few questions to start. Is this an on-going issue or one-time occurrence? What was the time period between the 2 deployments? Did you try to redeploy?

ryanfollmer commented 2 years ago

@patelchandni This is an on-going issue unfortunately.

The time period between the 1st and 2nd deployments was approx 2 hours. We did try to deploy again a few hours after the 2nd deploy and it still failed with the same 500 error.

We're able to deploy using Azure extensions in VS Code. But we're unable to do that with our CD process in GitHub Actions.

patelchandni commented 2 years ago

@ryanfollmer I noticed you said it's a Windows on consumption plan, but in the template it declares "runs-on: ubuntu-latest" i.e. Linux. Please clarify whether the function app is on Windows or Linux?

ryanfollmer commented 2 years ago

@patelchandni Yes, the function app is running on Windows in Azure.

patelchandni commented 2 years ago

@ryanfollmer please update your template accordingly. Here are examples for Function app on Windows: https://docs.microsoft.com/en-us/azure/azure-functions/functions-how-to-github-actions?tabs=javascript#deploy-the-function-app

github-actions[bot] commented 2 years ago

This issue is idle because it has been open for 14 days with no activity.