理解 Azure 流分析的输入Understand inputs for Azure Stream Analytics

Azure 流分析作业连接到一个或多个数据输入。Azure Stream Analytics jobs connect to one or more data inputs. 每个输入定义一个到现有数据源的连接。Each input defines a connection to an existing data source. 流分析接受来自多种事件源的数据,这包括事件中心、IoT 中心和 Blob 存储。Stream Analytics accepts data incoming from several kinds of event sources including Event Hubs, IoT Hub, and Blob storage. 输入在为每个作业编写的流式处理 SQL 查询中通过名称进行引用。The inputs are referenced by name in the streaming SQL query that you write for each job. 在查询中,可以对多个输入进行联接来混合数据或者将流式处理数据与查找到的引用数据进行比较,并将结果传递到输出。In the query, you can join multiple inputs to blend data or compare streaming data with a lookup to reference data, and pass the results to outputs.

流分析完美集成了作为输入的以下三种资源:Stream Analytics has first-class integration with three kinds of resources as inputs:

这些输入资源与流分析作业可以属于同一 Azure 订阅,也可以属于不同的订阅。These input resources can live in the same Azure subscription as your Stream Analytics job, or from a different subscription.

要创建、编辑和测试流分析作业输入,可使用 Azure 门户Azure PowerShell.Net APIREST APIYou can use the Azure portal, Azure PowerShell, .NET API, and REST API to create, edit, and test Stream Analytics job inputs.

流输入和引用输入Stream and reference inputs

将数据推送到数据源后,流分析作业就可使用该数据并对其进行实时处理。As data is pushed to a data source, it's consumed by the Stream Analytics job and processed in real time. 输入分为两种类型:数据流输入和引用数据输入。Inputs are divided into two types: data stream inputs and reference data inputs.

数据流输入Data stream input

数据流是一段时间内不受限制的事件序列。A data stream is an unbounded sequence of events over time. 流分析作业必须至少包含一个数据流输入。Stream Analytics jobs must include at least one data stream input. 事件中心、IoT 中心和 Blob 存储均可作为数据流输入源。Event Hubs, IoT Hub, and Blob storage are supported as data stream input sources. 事件中心用于从多个设备和服务收集事件流。Event Hubs are used to collect event streams from multiple devices and services. 这些流可能包括社交媒体活动源、股票交易信息或传感器数据。These streams might include social media activity feeds, stock trade information, or data from sensors. IoT 中心经过优化以从物联网 (IoT) 方案中连接的设备收集数据。IoT Hubs are optimized to collect data from connected devices in Internet of Things (IoT) scenarios. Blob 存储可用作按流的形式引入大容量数据(如日志文件)的输入源。Blob storage can be used as an input source for ingesting bulk data as a stream, such as log files.

有关流式处理数据输入的详细信息,请参阅将数据作为输入流式传输到流分析中For more information about streaming data inputs, see Stream data as input into Stream Analytics

引用数据输入Reference data input

流分析还支持称为“引用数据” 的输入。Stream Analytics also supports input known as reference data. 引用数据是完全静态的或更改缓慢。Reference data is either completely static or changes slowly. 它通常用于执行关联和查找。It is typically used to perform correlation and lookups. 例如,可以将数据流输入中的数据联接到引用数据中的数据,就像执行 SQL 联接以查找静态值一样。For example, you might join data in the data stream input to data in the reference data, much as you would perform a SQL join to look up static values. 当前支持将 Azure Blob 存储和 Azure SQL 数据库作为参考数据的输入源。Azure Blob storage and Azure SQL Database are currently supported as input sources for reference data. 参考数据源 blob 的大小限制最多为 300 MB,具体取决于查询复杂性和分配的流单元(有关详细信息,请参阅参考数据文档的大小限制部分)。Reference data source blobs have a limit of up to 300 MB in size, depending on the query complexity and allocated Streaming Units (see the Size limitation section of the reference data documentation for more details).

有关引用数据输入的详细信息,请参阅在流分析中使用引用数据进行查找For more information about reference data inputs, see Using reference data for lookups in Stream Analytics

后续步骤Next steps