我有一个 Azure Function v2,可以在本地运行.部署到 Azure 后,一切似乎都正常运行(包含二进制文件的 bin 文件夹和带有 function.json 的函数名称文件夹).
但是,当我检查它们是否运行(查看日志)时,它们不在监视器选项卡上(No data available
)、kudu 日志流也不在一般功能视图中:
2018-01-25T10:27:47 欢迎您,您现在已连接到日志流服务.2018-01-25T10:28:47 在过去 1 分钟内没有新的跟踪.2018-01-25T10:29:47 在过去 2 分钟内没有新的踪迹.
信息:
function.json:
<代码>{"generatedBy": "Microsoft.NET.Sdk.Functions.Generator-1.0.6","configurationSource": "属性",绑定":[{"type": "timerTrigger","时间表": "0 */1 * * * *",useMonitor":是的,runOnStartup":假,名称":计时器信息"}],禁用":假,"scriptFile": "../bin/Namespace.dll",入口点":命名空间.RetrieveRedisMetrics.RunOrchestrator"}
我有:
该行为似乎类似于
显然,您需要将 FUNCTIONS_EXTENSION_VERSION
设置为 beta
.
ARM 模板:
<代码>{"名称": "FUNCTIONS_EXTENSION_VERSION","value": "beta"//是 ~1}
Azure 门户(Azure 函数应用程序设置):
它也适用于持续交付.现在唯一的问题是 AF v1(目前是预览版)比 AF v1 花费的时间长 3 到 4 倍.但那是另一回事了..
I have an Azure Function v2, which works locally. When deployed to Azure, everything seems to be in working order (bin folder containing binaries and function name folder with function.json).
However, when I check if they ran (viewing the logs), they aren't there on the monitor tab (No data available
), the kudu log stream nor in the general function view:
2018-01-25T10:27:47 Welcome, you are now connected to log-streaming service.
2018-01-25T10:28:47 No new trace in the past 1 min(s).
2018-01-25T10:29:47 No new trace in the past 2 min(s).
Info:
function.json:
{
"generatedBy": "Microsoft.NET.Sdk.Functions.Generator-1.0.6",
"configurationSource": "attributes",
"bindings": [
{
"type": "timerTrigger",
"schedule": "0 */1 * * * *",
"useMonitor": true,
"runOnStartup": false,
"name": "timerInfo"
}
],
"disabled": false,
"scriptFile": "../bin/Namespace.dll",
"entryPoint": "Namespace.RetrieveRedisMetrics.RunOrchestrator"
}
I have:
The behavior seems similar to https://github.com/Azure/Azure-Functions/issues/618, but there is no resolution or comment on that bug.
I can't share the information app name privately (according to https://github.com/Azure/azure-webjobs-sdk-script/wiki/Sharing-Your-Function-App-name-privately), since... The function isn't logging!
Any other ideas/recommendations?
When trying to publish the function from Visual Studio to skip the TFS continuous delivery factor, I got the following popup:
Apparently, you need to set the FUNCTIONS_EXTENSION_VERSION
to beta
.
ARM template:
{
"name": "FUNCTIONS_EXTENSION_VERSION",
"value": "beta" // was ~1
}
Azure portal (Azure Function Application Settings):
It also works with Continuous Delivery. Only problem now is that AF v1 (preview currently) takes 3 to 4 times longer than the AF v1. But that is another story..
这篇关于部署的 Azure Function (v2) 未运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!