【问题标题】:Unable to deploy basic example HttpRequest1 to Azure Function using VSCODE Python无法使用 VSCODE Python 将基本示例 HttpRequest1 部署到 Azure 函数
【发布时间】:2022-08-24 04:42:26
【问题描述】:

下午大家,

第一次来这里,我在一个真正的泡菜中。 我无法弄清楚为什么部署失败到 Azure Functions。 我已经搜索了网络以解决这个问题,我真的很难过。 如果您有任何想法或建议,请告诉我!

这是 VS Code 给出的错误输出。使用 Python venv 3.8.8

14:32:52 eTendersTests: Starting deployment...
14:32:57 eTendersTests: Creating zip package...
14:32:57 eTendersTests: Zip package size: 2.44 kB
14:33:01 eTendersTests: Fetching changes.
14:33:02 eTendersTests: Cleaning up temp folders from previous zip deployments and extracting pushed zip file /tmp/zipdeploy/f670fa18-4068-42c0-925b-752b66739c18.zip (0.00 MB) to /tmp/zipdeploy/extracted
14:33:04 eTendersTests: Updating submodules.
14:33:05 eTendersTests: Preparing deployment for commit id \'95126602-7\'.
14:33:05 eTendersTests: PreDeployment: context.CleanOutputPath False
14:33:05 eTendersTests: PreDeployment: context.OutputPath /home/site/wwwroot
14:33:05 eTendersTests: Repository path is /tmp/zipdeploy/extracted
14:33:05 eTendersTests: Running oryx build...
14:33:05 eTendersTests: Command: oryx build /tmp/zipdeploy/extracted -o /home/site/wwwroot --platform python --platform-version 3.9 -p packagedir=.python_packages/lib/site-packages
14:33:07 eTendersTests: Operation performed by Microsoft Oryx, https://github.com/Microsoft/Oryx
14:33:07 eTendersTests: You can report issues at https://github.com/Microsoft/Oryx/issues
14:33:07 eTendersTests: Oryx Version: 0.2.20210120.1, Commit: 66c7820d7df527aaffabd2563a49ad57930999c9, ReleaseTagName: 20210120.1
14:33:07 eTendersTests: Build Operation ID: |Yui9lstuThc=.75fae38b_
14:33:07 eTendersTests: Repository Commit : 95126602-7dce-46da-be06-41ab4abf3a44
14:33:07 eTendersTests: Detecting platforms...
14:33:07 eTendersTests: Detected following platforms:
14:33:07 eTendersTests:   python: 3.9.7
14:33:07 eTendersTests: Version \'3.9.7\' of platform \'python\' is not installed. Generating script to install it...
14:33:08 eTendersTests: Source directory     : /tmp/zipdeploy/extracted
14:33:08 eTendersTests: Destination directory: /home/site/wwwroot
14:33:08 eTendersTests: Downloading and extracting \'python\' version \'3.9.7\' to \'/tmp/oryx/platforms/python/3.9.7\'...
14:33:08 eTendersTests: Downloaded in 0 sec(s).
14:33:08 eTendersTests: Verifying checksum...
14:33:09 eTendersTests: Extracting contents...
14:33:12 eTendersTests: Done in 4 sec(s).
14:33:12 eTendersTests: Python Version: /tmp/oryx/platforms/python/3.9.7/bin/python3.9
14:33:12 eTendersTests: Running pip install...
14:33:13 eTendersTests: [04:33:13+0000] Collecting azure-functions
14:33:13 eTendersTests: [04:33:13+0000]   Downloading azure_functions-1.11.2-py3-none-any.whl (206 kB)
14:33:13 eTendersTests: [04:33:13+0000] Installing collected packages: azure-functions
14:33:13 eTendersTests: [04:33:13+0000] Successfully installed azure-functions-1.11.2
14:33:14 eTendersTests: WARNING: You are using pip version 20.2.3; however, version 22.1.2 is available.
14:33:14 eTendersTests: You should consider upgrading via the \'/tmp/oryx/platforms/python/3.9.7/bin/python3.9 -m pip install --upgrade pip\' command.
14:33:14 eTendersTests: Done in 2 sec(s).
14:33:14 eTendersTests: Preparing output...
14:33:14 eTendersTests: Copying files to destination directory \'/home/site/wwwroot\'...
14:33:14 eTendersTests: Done in 0 sec(s).
14:33:15 eTendersTests: Removing existing manifest file
14:33:15 eTendersTests: Creating a manifest file...
14:33:15 eTendersTests: Manifest file created.
14:33:15 eTendersTests: Done in 6 sec(s).
14:33:15 eTendersTests: Running post deployment command(s)...
14:33:15 eTendersTests: Generating summary of Oryx build
14:33:15 eTendersTests: Deployment Log file does not exist in /tmp/oryx-build.log
14:33:15 eTendersTests: The logfile at /tmp/oryx-build.log is empty. Unable to fetch the summary of build
14:33:15 eTendersTests: Triggering recycle (preview mode disabled).
14:33:15 eTendersTests: Linux Consumption plan has a 1.5 GB memory limit on a remote build container.
14:33:15 eTendersTests: To check our service limit, please visit https://docs.microsoft.com/en-us/azure/azure-functions/functions-scale#service-limits
14:33:15 eTendersTests: Creating placeholder blob for linux consumption function app...
14:33:15 eTendersTests: Malformed SCM_RUN_FROM_PACKAGE when uploading built content.
14:33:15 eTendersTests: Generating summary of Oryx build
14:33:15 eTendersTests: Deployment Log file does not exist in /tmp/oryx-build.log
14:33:15 eTendersTests: The logfile at /tmp/oryx-build.log is empty. Unable to fetch the summary of build
14:33:15 eTendersTests: Deployment Failed.
14:33:24 eTendersTests: Deployment failed.
14:35:55 eTendersTests: Starting deployment...
14:35:58 eTendersTests: Creating zip package...
14:35:58 eTendersTests: Zip package size: 2.44 kB
14:36:00 eTendersTests: Fetching changes.
14:36:01 eTendersTests: Cleaning up temp folders from previous zip deployments and extracting pushed zip file /tmp/zipdeploy/5d3f2d78-9904-453e-9e73-c833f30cacf4.zip (0.00 MB) to /tmp/zipdeploy/extracted
14:36:03 eTendersTests: Updating submodules.
14:36:04 eTendersTests: Preparing deployment for commit id \'5adc9561-c\'.
14:36:04 eTendersTests: PreDeployment: context.CleanOutputPath False
14:36:04 eTendersTests: PreDeployment: context.OutputPath /home/site/wwwroot
14:36:04 eTendersTests: Repository path is /tmp/zipdeploy/extracted
14:36:04 eTendersTests: Running oryx build...
14:36:04 eTendersTests: Command: oryx build /tmp/zipdeploy/extracted -o /home/site/wwwroot --platform python --platform-version 3.9 -p packagedir=.python_packages/lib/site-packages
14:36:06 eTendersTests: Operation performed by Microsoft Oryx, https://github.com/Microsoft/Oryx
14:36:06 eTendersTests: You can report issues at https://github.com/Microsoft/Oryx/issues
14:36:06 eTendersTests: Oryx Version: 0.2.20210120.1, Commit: 66c7820d7df527aaffabd2563a49ad57930999c9, ReleaseTagName: 20210120.1
14:36:06 eTendersTests: Build Operation ID: |yJLJ95+U9fQ=.b4d71421_
14:36:06 eTendersTests: Repository Commit : 5adc9561-c840-47cb-83a4-9ff9451595ed
14:36:06 eTendersTests: Detecting platforms...
14:36:08 eTendersTests: Detected following platforms:
14:36:08 eTendersTests:   python: 3.9.7
14:36:08 eTendersTests: Version \'3.9.7\' of platform \'python\' is not installed. Generating script to install it...
14:36:08 eTendersTests: Source directory     : /tmp/zipdeploy/extracted
14:36:08 eTendersTests: Destination directory: /home/site/wwwroot
14:36:08 eTendersTests: Downloading and extracting \'python\' version \'3.9.7\' to \'/tmp/oryx/platforms/python/3.9.7\'...
14:36:09 eTendersTests: Downloaded in 1 sec(s).
14:36:09 eTendersTests: Verifying checksum...
14:36:09 eTendersTests: Extracting contents...
14:36:13 eTendersTests: Done in 5 sec(s).
14:36:13 eTendersTests: Python Version: /tmp/oryx/platforms/python/3.9.7/bin/python3.9
14:36:13 eTendersTests: Running pip install...
14:36:14 eTendersTests: [04:36:14+0000] Collecting azure-functions
14:36:14 eTendersTests: [04:36:14+0000]   Downloading azure_functions-1.11.2-py3-none-any.whl (206 kB)
14:36:14 eTendersTests: [04:36:14+0000] Installing collected packages: azure-functions
14:36:14 eTendersTests: [04:36:14+0000] Successfully installed azure-functions-1.11.2
14:36:15 eTendersTests: WARNING: You are using pip version 20.2.3; however, version 22.1.2 is available.
14:36:15 eTendersTests: You should consider upgrading via the \'/tmp/oryx/platforms/python/3.9.7/bin/python3.9 -m pip install --upgrade pip\' command.
14:36:15 eTendersTests: Done in 2 sec(s).
14:36:15 eTendersTests: Preparing output...
14:36:15 eTendersTests: Copying files to destination directory \'/home/site/wwwroot\'...
14:36:15 eTendersTests: Done in 0 sec(s).
14:36:15 eTendersTests: Removing existing manifest file
14:36:15 eTendersTests: Creating a manifest file...
14:36:15 eTendersTests: Manifest file created.
14:36:15 eTendersTests: Done in 7 sec(s).
14:36:16 eTendersTests: Running post deployment command(s)...
14:36:16 eTendersTests: Generating summary of Oryx build
14:36:16 eTendersTests: Deployment Log file does not exist in /tmp/oryx-build.log
14:36:16 eTendersTests: The logfile at /tmp/oryx-build.log is empty. Unable to fetch the summary of build
14:36:16 eTendersTests: Triggering recycle (preview mode disabled).
14:36:16 eTendersTests: Linux Consumption plan has a 1.5 GB memory limit on a remote build container.
14:36:16 eTendersTests: To check our service limit, please visit https://docs.microsoft.com/en-us/azure/azure-functions/functions-scale#service-limits
14:36:16 eTendersTests: Creating placeholder blob for linux consumption function app...
14:36:16 eTendersTests: Malformed SCM_RUN_FROM_PACKAGE when uploading built content.
14:36:16 eTendersTests: Generating summary of Oryx build
14:36:16 eTendersTests: Deployment Log file does not exist in /tmp/oryx-build.log
14:36:16 eTendersTests: The logfile at /tmp/oryx-build.log is empty. Unable to fetch the summary of build
14:36:16 eTendersTests: Deployment Failed.
14:36:33 eTendersTests: Deployment failed.

    标签: python azure function deployment


    【解决方案1】:

    卸载所有python版本,VSCode,重新启动。

    重新安装 VSCODE、Python 3.9(完全正确)并创建一个新的 Function App(通过 VS CODE)并部署。

    【讨论】:

    • 如果您认为这可以解决问题,请考虑将此标记为已接受的答案
    【解决方案2】:

    /tmp/oryx-build.log 中不存在部署日志文件 14:36:16 eTendersTests:/tmp/oryx-build.log 中的日志文件为空。无法获取构建摘要 14:36:16 eTendersTests:部署失败。 14:36:33 eTendersTests:部署失败。

    输出终端错误消息显示您可能错过了项目中的某些包。

    确保将所有包都包含在 azure 项目中。重新检查您的需求.txt在部署之前提交一次文件,您已经包含了所有必要的包。

    重启你的视觉工作室如果您仍然无法部署您的 azure 功能,则有一次。

    结果

    【讨论】:

      【解决方案3】:

      我遇到了这个问题并手动运行:

      func azure functionapp publish <AZURE_FUNCTION_NAME_GOES_HERE> --build remote
      

      我仍然遇到与日志相关的问题,但应用程序已部署。

      ...
      Generating summary of Oryx build
      Deployment Log file does not exist in /tmp/oryx-build.log
      The logfile at /tmp/oryx-build.log is empty. Unable to fetch the summary of build
      Triggering recycle (preview mode disabled).
      Deployment successful.
      Remote build succeeded!
      

      (当时我也从消费计划切换到标准计划,所以我不确定哪一个帮助我解决了这个问题)。

      还有一些其他选项可以解决此问题here,但它们不适用于我。

      希望这对某人有帮助!

      【讨论】:

        猜你喜欢
        • 2021-12-12
        • 1970-01-01
        • 1970-01-01
        • 2020-01-05
        • 1970-01-01
        • 2021-10-03
        • 1970-01-01
        • 2023-02-11
        • 1970-01-01
        相关资源
        最近更新 更多