Azure 流分析无法触发 Azure Function
Posted
技术标签:
【中文标题】Azure 流分析无法触发 Azure Function【英文标题】:Azure Stream Analytics failed to trigger Azure Function 【发布时间】:2018-05-14 14:54:38 【问题描述】:我创建了一个 Azure 函数,用于在设备向 Azure IoT 中心发送数据时将结果返回给设备。我按照tutorial 将输出发送到 SQL 和 Azure 函数。这是我的 ASA 查询。
WITH subquery as (
SELECT
messageId,
deviceId,
temperature,
humidity,
EventProcessedUtcTime,
DemoML(temperature, humidity) as result1
from DemoInput
)
SELECT
messageId as messageId,
deviceId as deviceId,
temperature as temperature,
humidity as humidity,
EventProcessedUtcTime as EventProcessedUtcTime,
result1.[Scored Labels] as result,
result1.[Scored Probabilities] as resultProbability
INTO
[DemoOutput]
FROM
[subquery]
SELECT
*
INTO
[c2d]
FROM
[subquery]
我不知道为什么它不会触发 Azure 功能。但是当我将最后一行从 [subquery] 更改为 [DemoInput] 时,它将起作用。为什么会这样?
【问题讨论】:
DemoOutput 怎么样?它在工作吗?出于测试目的,添加 Blob 存储的输出并将查询 c2d 中的替换为 DemoOutputBlob。 DemoOutput 输出到 SQL。它正在工作。 【参考方案1】:仅出于测试目的尝试以下查询。请注意,我取出了您的 DemoML 函数,输出用于 Blob 存储。您应该会在 AF 和 Blob 存储中看到输出:
WITH subquery as (
SELECT
System.Timestamp as time,
temperature,
humidity,
EventProcessedUtcTime,
IoTHub.ConnectionDeviceId as deviceId,
IoTHub.MessageId as messageId
FROM
DemoInput Timestamp by time
)
SELECT
messageId as messageId,
deviceId as deviceId,
temperature as temperature,
humidity as humidity,
EventProcessedUtcTime as EventProcessedUtcTime
INTO
DemoOutputBlob
FROM
subquery
SELECT
*
INTO
c2d
FROM
subquery
【讨论】:
嗨,我在另一篇文章中问了这个问题,因为我意识到问题出在 Azure 函数应用程序上。你能帮我看看吗? ***.com/questions/47604272/…以上是关于Azure 流分析无法触发 Azure Function的主要内容,如果未能解决你的问题,请参考以下文章