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:
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.