python - Azure 函数 - Python - Visual Studio 代码
问题描述
我正在尝试在 Azure Functions 中执行 Hello World 代码。我正在从 Visual Studio Code 调用 python 代码 - Azure Function 中的博客存储触发器。
我没有对 init.py 进行任何更改。我收到以下错误:
Found Python version 3.8.0 (py).
Azure Functions Core Tools (3.0.2881 Commit hash: fa9641ad925588192888bc977ff****************)
Function Runtime Version: 3.0.14287.0
A host error has occurred during startup operation '7bad93bb-xxxx-4da0-9461-55fc9deaxxxx'.
System.Net.Http: Error while copying content to a stream. System.Net.Security: Received an unexpected EOF or 0 bytes from the transport stream.
Value cannot be null. (Parameter 'provider')
Application is shutting down...
The terminal process "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -Command .venv\Scripts\activate ; func host start" terminated with exit code: 1.
关于必须做些什么来解决这个问题的任何帮助?谢谢。
解决方案
由于您没有更改代码中的任何内容,因此您的函数在上传到 azure 后应该可以工作。
该错误似乎与 tls 版本有关。
如果只想简单测试一下,可以直接在 Azure 上创建一个基于 python 的函数应用。
如果您使用的是 blob 触发器,它实际上会将数据转换为流。因此,可以使用普通的python脚本进行模拟,只需要在模拟完成后放入azure函数的函数体中即可。
另外,还是希望大家能展示一下代码和配置文件。(如果没有问题,应该在 Azure 上运行良好,问题应该是本地的。)
推荐阅读
- karate - 空手道测试:如何从响应对象中获取特定字段的列表
- python - Keras ValueError:形状 (256, 652) 和 (256, 64) 不兼容
- html - WKWebView 忽略位置:已修复 html 导航栏
- android - 在哪里下载适用于 Android Studio 4.0 的 lint-checks-27.0.0.jar?
- javascript - 将消息从注册服务人员发送到客户端页面
- javascript - 来自其他 js 文件的 .vue 中的远程通知
- botframework - 如何处理“会话状态超过 110kb 大小限制”。在 BotBuilder 框架中?
- flutter - 我可以在变量上保存一些命名参数,以便重用它吗?
- python - 如果语句条件满足但不执行(Python)
- python - 无法通过表单输入理解烧瓶 url 路由