Azure functions deploy from github actions results in Error: connect ECONNREFUSED 127.0.0.1:443

女生的网名这么多〃 提交于 2021-01-29 08:11:37

问题


I have the following yaml file in my .github/workflows folder which I got from here.

name: Deploy Python project to Azure Function App

on:
  [push]

env:
  AZURE_FUNCTIONAPP_NAME: zypp-covid # 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
  PYTHON_VERSION: '3.8'                 # set this to the python version to use (supports 3.6, 3.7, 3.8)

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

    - name: Setup Python ${{ env.PYTHON_VERSION }} Environment
      uses: actions/setup-python@v1
      with:
        python-version: ${{ env.PYTHON_VERSION }}

    - name: 'Resolve Project Dependencies Using Pip'
      shell: bash
      run: |
        pushd './${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}'
        python -m pip install --upgrade pip
        pip install -r requirements.txt --target=".python_packages/lib/site-packages"
        popd
    - name: 'Run Azure Functions Action'
      uses: Azure/functions-action@v1
      id: fa
      with:
        app-name: ${{ env.AZURE_FUNCTIONAPP_NAME }}
        package: ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}
        publish-profile: ${{ secrets.AZURE_FUNCTIONAPP_PUBLISH_PROFILE }}

This results in the following error which isn't very informative, so I have no clue how to solve this:

Using SCM credential for authentication, GitHub Action will not perform resource validation.
Error: ECONNREFUSED
Error: Execution Exception (state: ValidateAzureResource) (step: Invocation)
Error:   When request Azure resource at ValidateAzureResource, Get Function App Settings : Failed to acquire app settings (SCM)
Error:     Failed to fetch Kudu App Settings.
Error: connect ECONNREFUSED 127.0.0.1:443
Error:       Error: Failed to fetch Kudu App Settings.
Error: connect ECONNREFUSED 127.0.0.1:443
    at Kudu.<anonymous> (/home/runner/work/_actions/Azure/functions-action/v1/node_modules/azure-actions-appservice-rest/Kudu/azure-app-kudu-service.js:62: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!

Could someone point me in the right direction?


回答1:


I had exactly the same error. I created a virgin http trigger function in .net core 3.1, a new Azure function, downloaded the profile to find a url issue that Microsoft are responsible for that was not correct. Get past that then I end up with the same as the above.

This was infuriating. Working it through from basics and it fails. The url issue is found here: https://docs.microsoft.com/en-us/answers/questions/137869/publish-profile-publishurl-needs-to-be-adjusted-af.html

The problem lies with the updated url.

The original in my test scenario from the publish profile was:

publishUrl="waws-prod-ln1-035.publish.azurewebsites.windows.net:443"

This I changed to:

publishUrl="ps-az-02.scm.azurewebsites.windows.net:443"

Which gives the same results as your code.

Upon close examination from an older profile, after many hours trying to trouble shoot the whole publishing problem, I changed to:

publishUrl="ps-az-02.scm.azurewebsites.net:443"

Which works!

Hope this helps someone.



来源:https://stackoverflow.com/questions/64502419/azure-functions-deploy-from-github-actions-results-in-error-connect-econnrefuse

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!