Publish profile publishUrl needs to be adjusted after downloading it from Azure Function for deployment from Github Actions

Erfan Nariman 436 Reputation points
2020-10-24T23:00:21.043+00:00

I want to deploy my Function app to Azure through GitHub Actions. I set my publish profile as "secret" in my Github repository. And have the following yaml file in .github/workflows:

   yaml  
   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 }}  

And I download the Publish Profile:
34694-screenshot-2020-10-25-at-005244.png

But deploying it this way results in the following error:

   Run Azure/functions-action@v1  
   ##[Initialize]  
   ##[ValidateParameter]  
   Error: Execution Exception (state: ValidateParameter) (step: Invocation)  
   Error:   At ValidateParameter, publish-profile : should contain scm URL.  
   Error: Deployment Failed!  

To fix this I have to change the "publishUrl" in the download Publish Profile file from:

   publishUrl="waws-prod-am2-311.publish.azurewebsites.windows.net:443"  

To

   publishUrl="[zypp-covid].scm.azurewebsites.windows.net:433"  

This seems like a problem where other users run into as well link.

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

3 answers

Sort by: Most helpful
  1. Nicholas Jory 6 Reputation points
    2020-10-29T18:03:34.09+00:00

    DANGER!

    This is close but not exactly right.

    Changing:

    publishUrl="waws-prod-am2-311.publish.azurewebsites.windows.net:443"  
    

    To:

    publishUrl="[zypp-covid].scm.azurewebsites.windows.net:433"  
    

    Stops some errors but creates others the url should be:

    publishUrl="zypp-covid.scm.azurewebsites.net:433"  
    

    The windows part stops an aspect of authentication which looks like:

    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!  
    

    Thank you @Erfan Nariman for your article it really helped in solving this one.

    1 person found this answer helpful.
    0 comments No comments

  2. MayankBargali-MSFT 67,081 Reputation points
    2020-10-30T16:13:58.983+00:00

    Hi @Erfan Nariman

    Apology for the delay. I have got an update from my team that they are working on fixing this issue and I will update my answer once the issue is fixed.

    For now, you should be able to work around this by adding the below app setting
    WEBSITE_WEBDEPLOY_USE_SCM = true

    Once you have added the above setting and download the profile, it should be reset back to the SCM site.

    Update:
    The fix is targetting Build 91 and you can verify the build version by navigating to the Kudo console (https://yourfunctionapp.scm.azurewebsites.net/)
    The current build version is 90.*

    39217-image.png

    MSTechie-7364 ·


  3. Orthodoxos Kipouridis 1 Reputation point
    2023-05-30T20:35:38.5666667+00:00

    I was getting a similar error from a failing GitHub Action, needed to enable basic authentication for the Azure Fuction App SCM Access

    Function App -> Configuration -> General Settings Tab

    User's image

    0 comments No comments