我似乎无法诊断为什么我的基于python的azure函数(通过gihub操作部署的)没有出现在azure函数列表中.一些微妙的东西导致它无法被处理

I have successfully deployed my python script using github actions (see pic1). enter image description here

我已经成功地在我的Azure功能中看到了应用程序文件(参见Pic2).

enter image description here

And yet I am unable to see my function within the functions list (see pic3). enter image description here

我觉得,如果我有能力看到Azure正在处理我的文件的内容或方式,看看是否有一些配置或模块或其他方面的问题,那么我就有了一个起点.但现在感觉就像一个黑匣子,我不知道应该遵循什么方法来找出哪里出了问题.

我感觉有一些简单的东西丢失或配置错误,请帮助

推荐答案

我使用Github Actionstry 了Azure功能部署,并取得了成功.

最初,当我部署该功能时,它是不可见的,请参阅以下内容:

enter image description here

确保您的init.py和unction.json位于一个目录中,而其他文件位于该目录之外,以使部署成功工作,请参阅以下内容:-

参考文献:-SO Thread由jseaske回答

enter image description here

现在,我使用Github操作部署了该功能,并且该功能在门户中可见,如下所示:

Refer my complete github workflow in this 100.

name: Build and deploy Python project to Azure Function App - siliconfunc12

on:
  push:
    branches:
      - main
  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.10' # set this to the python version to use (supports 3.6, 3.7, 3.8)

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v2

      - name: Setup Python version
        uses: actions/setup-python@v1
        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: Upload artifact for deployment job
        uses: actions/upload-artifact@v2
        with:
          name: python-app
          path: |
            . 
            !venv/

  deploy:
    runs-on: ubuntu-latest
    needs: build
    environment:
      name: 'Production'
      url: ${{ steps.deploy-to-function.outputs.webapp-url }}

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

      - name: 'Deploy to Azure Functions'
        uses: Azure/functions-action@v1
        id: deploy-to-function
        with:
          app-name: 'siliconfunc12'
          slot-name: 'Production'
          package: ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}
          publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_E640D92BF68849679F8A36682B022D5F }}
          scm-do-build-during-deployment: true
          enable-oryx-build: true

Output:-

enter image description here

enter image description here

100

enter image description here

添加以下设置以从Zip运行您的功能应用程序:-

enter image description here

HTTPTrigger成功运行如下:-

enter image description here

enter image description here

您可以使用Github从部署中心直接运行您的功能应用程序部署,Github将自动创建Github工作流,并将您的功能触发器部署到功能应用程序,请参阅以下内容:

enter image description here

Python相关问答推荐

更改Seaborn条形图中的x轴日期时间限制

不允许AMBIMA API请求方法

如何将ctyles.POINTER(ctyles.c_float)转换为int?

如何比较numPy数组中的两个图像以获取它们不同的像素

非常奇怪:tzLocal.get_Localzone()基于python3别名的不同输出?

删除所有列值,但判断是否存在任何二元组

' osmnx.shortest_track '返回有效源 node 和目标 node 的'无'

在Mac上安装ipython

如何请求使用Python将文件下载到带有登录名的门户网站?

Python解析整数格式说明符的规则?

ThreadPoolExecutor和单个线程的超时

合并帧,但不按合并键排序

使用Python查找、替换和调整PDF中的图像'

dask无groupby(ddf. agg([min,max])?''''

Polars将相同的自定义函数应用于组中的多个列,

从旋转的DF查询非NaN值

仅使用预先计算的排序获取排序元素

Pandas数据框上的滚动平均值,其中平均值的中心基于另一数据框的时间

Polars表达式无法访问中间列创建表达式

查找查找表中存在的列值组合