我目前正在尝试使用 Github Actions 将 Python Azure 函数部署到函数应用程序。
部署代码如下:-
name: Deploy Azure Function Dev
env:
PYTHON_VERSION: "3.7"
WORKING_DIR: ${{ github.workspace }}/data-science-data-acquisition
FUNCTION_APP_DEV: "data-science-data-acquisition"
on:
pull_request:
branches: [master]
types: [opened,reopened,edited]
paths:
- 'data-science-data-acquisition/**'
push:
branches: [master]
paths:
- 'data-science-data-acquisition/**'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: "Checkout"
uses: actions/checkout@v1
- name: Setup Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v1
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: 'Run pip'
shell: bash
run: |
# If your function app project is not located in your repository's root
# Please change your directory for pip in pushd
pushd ${{ env.WORKING_DIR }}
python -m pip install --upgrade pip
pip install -r requirements.txt --target=".python_packages/lib/python3.6/site-packages"
popd
- name: 'Azure Login'
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS_DEV }}
- name: 'Deploy Function App'
uses: Azure/functions-action@v1
id: fa
with:
app-name: ${{ env.FUNCTION_APP_DEV }}
package: ${{ env.WORKING_DIR }}
我们目前在部署时遇到问题,但是 Github Actions 中的输出非常有限:-
##[PublishContent]
Waiting for function app to spin up after app settings change.
Package deployment using ZIP Deploy initiated.
##[error]Failed to deploy web package to App Service.
##[warning]Error: Failed to update deployment history.
Bad Request (CODE: 400)
当直接从 VSCode 部署时,会出现更详细的输出,这显然对部署故障排除非常有用:有没有办法从 Github Actions 部署中启用/访问它?
我已经检查了Azure/functions-action 的文档和 Python 特定示例,但看不到任何启用此功能的内容。
慕姐4208626
相关分类