我正在尝试使用visualstudio代码在本地计算机上运行azure函数。 我的主.py看起来像这样:
import logging
import azure.functions as func
def main(event: func.EventHubEvent):
logging.info('Python EventHub trigger processed an event: %s', event.get_body().decode('utf-8'))
我的主机.json文件如下所示:
{
"version": "2.0",
"extensionBundle": {
"id": "Microsoft.Azure.Functions.ExtensionBundle",
"version": "[1.*, 2.0.0)"
}
}
我的函数.json看起来像这样:
{
"scriptFile": "main.py",
"bindings": [
{
"type": "eventHubTrigger",
"name": "event",
"direction": "in",
"eventHubName": "myhubName",
"connection": "myHubConnection",
"cardinality": "many",
"consumerGroup": "$Default"
}
]
}
问题是当我运行这个时,它会抛出以下错误:
A host error has occurred at Microsoft.AspNetCore.DataProtection: An error occurred while trying to encrypt the provided data. Refer to the inner exception for more information. Microsoft.AspNetCore.DataProtection: The key ring does not contain a valid default protection key. The data protection system cannot create a new key because auto-generation of keys is disabled. Value cannot be null. Parameter name: provider
我不知道我错过了什么?感谢您的帮助
Azure存储帐户出现问题:
确保local.settings.json文件具有存储帐户的正确凭据
相关问题 更多 >
编程相关推荐