在哪里可以找到用Powershell编写的Http触发功能的应用程序服务日志?

问题描述 投票:0回答:1

在Azure中,我使用Powershell Core Runtime堆栈创建Function App:

screenshot 1

然后我添加带有以下代码的Http触发器:

using namespace System.Net

# Input bindings are passed in via param block.
param($Request, $TriggerMetadata)

# Write to the Azure Functions log stream.
Write-Host "PowerShell HTTP trigger function processed a request XXX."

然后我转到代码+测试,测试/运行,然后单击运行按钮。

在右侧的Output字段中,我看到HTTP响应内容。

但是底部的Logs字段仅显示

连接到应用程序见解

screenshot 2

我尝试导航到左侧菜单中的日志,但是App Service日志条目在此处被禁用:

此功能不适用于Function应用程序。请使用Application Insights。

screenshot 3

所以我尝试遵循建议并进入了Application Insights,但在那儿找不到我的踪迹-

screenshot 4

请帮助我找到踪迹

PowerShell HTTP触发功能已处理请求XXX。

azure azure-functions azure-application-insights azure-powershell azure-function-app
1个回答
0
投票

您可以在监视器下找到日志。请注意,将有5分钟的延迟来显示日志。而且它只会显示二十个最近的函数调用轨迹。

enter image description here

您也可以直接在应用程序见解中找到日志。

enter image description here

更新:

如果仍然无法在此处找到日志,则可以尝试重新启动功能以检查是否可以成功连接到Application Insights。

enter image description here

参考:

Monitor Azure Functions

© www.soinside.com 2019 - 2024. All rights reserved.