Azure Function App (Python) Bereitstellung aus GitHub -Aktionen ergibt ein Modul, das nicht gefunden wurdePython

Python-Programme
Anonymous
 Azure Function App (Python) Bereitstellung aus GitHub -Aktionen ergibt ein Modul, das nicht gefunden wurde

Post by Anonymous »

Ich habe den folgenden GitHub -Workflow, der nach Erwartung erstellt und bereitstellt.

Code: Select all

Result: Failure Exception: ModuleNotFoundError: No module named 'azure.storage'. Cannot find module. Please check the requirements.txt file for the missing module. For more info, please refer the troubleshooting guide: https://aka.ms/functions-modulenotfound.
< /code>
Die Workflow -Datei, die ich habe: < /p>
# Docs for the Azure Web Apps Deploy action: https://github.com/azure/functions-action
# More GitHub Actions for Azure: https://github.com/Azure/actions
# More info on Python, GitHub Actions, and Azure Functions: https://aka.ms/python-webapps-actions

name: Build and deploy Python project to Azure Function App - func-myinstance-dev-001

on:
push:
branches:
- production
workflow_dispatch:

env:
AZURE_FUNCTIONAPP_PACKAGE_PATH: '.' # set this to the path to your web app project, defaults to the repository root
PYTHON_VERSION: '3.11' # set this to the python version to use (supports 3.6, 3.7, 3.8)

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read #This is required for actions/checkout

steps:
- name: Checkout repository
uses: actions/checkout@v4

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

- name: Create and start virtual environment
run: |
python -m venv venv
source venv/bin/activate

- name: Install dependencies
run: pip install -r requirements.txt

# Optional: Add step to run tests here

- name: Zip artifact for deployment
run: zip release.zip ./* -r

- name: Upload artifact for deployment job
uses: actions/upload-artifact@v4
with:
name: python-app
path: |
release.zip
!venv/

deploy:
runs-on: ubuntu-latest
needs: build

steps:
- name: Download artifact from build job
uses: actions/download-artifact@v4
with:
name: python-app

- name: Unzip artifact for deployment
run: unzip release.zip

- name: 'Deploy to Azure Functions'
uses: Azure/functions-action@v1
id: deploy-to-function
with:
app-name: 'func-myinstance-dev-001'
slot-name: 'Production'
package: ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_xxx }}
< /code>
Ich habe auch die VS -Code -Erweiterung ausprobiert und wenn ich auf dieselbe Funktions -App bereitgestellt habe. Der Fehler ist nicht länger da. Anforderungen.txt: < /p>
azure-functions
azure-functions-durable
azure-storage-blob
azure-storage-queue
azure-cosmos
mysql-connector-python
pandas
sendgrid
azure-eventhub
azure-communication-email
cffi
incoming
certifi
Python -Version: 3.11

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post