我正在本地从 VSCode 运行一个 Azure 函数,该函数将字符串输出到 blob。我正在使用 Azurite 来模拟输出 blob 容器。我的函数如下所示:
import azure.functions as func
def main(mytimer: func.TimerRequest, outputblob:func.Out[str]):
outputblob.set("hello")
Run Code Online (Sandbox Code Playgroud)
我的 function.json:
{
"scriptFile": "__init__.py",
"bindings": [
{
"name": "mytimer",
"type": "timerTrigger",
"direction": "in",
"schedule": "0 * * * * *"
},
{
"name": "outputblob",
"type": "blob",
"dataType": "string",
"direction": "out",
"path": "testblob/hello"
}
]
}
Run Code Online (Sandbox Code Playgroud)
在 local.settings.json 中,我设置了"AzureWebJobsStorage": "UseDevelopmentStorage=true".
问题是,当我运行该函数并签入 Azure 存储资源管理器时,会创建容器 (testblob)(以及其他 2 个容器:azure-webjobs-hosts 和 azure-webjobs-secrets),但它是空的并且 Azure 存储资源管理器刷新时显示错误消息: 第一个参数必须是字符串类型或 Buffer、ArrayBuffer、Array 或类似 Array 的实例。Received undefined
该函数运行并且不返回任何错误消息。
当我使用队列而不是 blob …
python azure-storage azure-functions azure-storage-explorer azurite