Azure流分析的唯一EventId属性为NULL [英] Azure Stream Analytics Unique EventId Property is NULL

查看:77
本文介绍了Azure流分析的唯一EventId属性为NULL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为通过Azure流分析(IoT中心输入源)处理的每个事件分配唯一的ID.

I'm looking to assign a unique Id to each event that is processed via Azure Stream Analytics (IoT Hub input source).

似乎没有办法在ASA中分配新的随机Guid(就像在SQL中一样),但是我确实遇到了

It appears there is no way to just assign a new random Guid in ASA (like in SQL) but I did come across the following MSDN article which mentions being able to use the GetMetadataPropertyValue function to achieve what I want with the EventId property:

为输入事件创建唯一的ID(Guid),这对于主键目的.它是一致的(不是随机的),即流如果您返回,Google Analytics(分析)会为事件生成相同的ID时间并重新读取相同的输入事件.

Creates a unique id (Guid) for an input event, which can be useful for primary key purposes. It is consistent (not random) i.e., Stream Analytics will produce the same id for an event, if you go back in time and re-read the same input event.

我的问题是,每次在查询生成器中尝试该函数时,此函数都会返回NULL.我是否缺少某些东西,或者是否有另一种方法来为活动获取唯一ID?

The issue I have is this function returns NULL each time when I try it in the query builder. Am I missing something or is there another way to achieve a Unique Id for an event?

推荐答案

不幸的是,当您从示例数据中测试该属性时,此属性不起作用(我们需要一些其他元数据).但是,当您通过Event Hub或IoT Hub对实时数据运行作业时,应该获得GUID值.

Unfortunately this property doesn't work when you test it from sample data (we need some additional metadata). However you should get the GUID value when you run the job on live data from Event Hub or IoT Hub.

让我知道它是否对您有用!不便之处,敬请谅解.

Let me know if it works for you! Sorry for the inconvenience.

JS

这篇关于Azure流分析的唯一EventId属性为NULL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆