Skip to content

Commit e8ae105

Browse files
authored
Merge pull request #122659 from mamccrea/decouple-outputs
Stream Analytics: decouple outputs article
2 parents 8f2ff61 + 2ce15ae commit e8ae105

19 files changed

+734
-367
lines changed

articles/azure-sql/database/stream-data-stream-analytics-integration.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Users can now ingest, process, view, and analyze real-time streaming data into a
2626
- Additional ease of use with preview data: Preview incoming data from the events source (Event Hub/IoT Hub) in the context of selected table
2727

2828
> [!IMPORTANT]
29-
> An Azure Stream Analytics job can output to Azure SQL Database, Azure SQL Managed Instance, or Azure Synapse Analytics (formerly Azure SQL Data Warehouse). For more information, see [Outputs](../../stream-analytics/stream-analytics-define-outputs.md#sql-database).
29+
> An Azure Stream Analytics job can output to Azure SQL Database, Azure SQL Managed Instance, or Azure Synapse Analytics (formerly Azure SQL Data Warehouse). For more information, see [Outputs](../../stream-analytics/sql-database-output.md).
3030
3131
## Prerequisites
3232

@@ -45,7 +45,7 @@ To complete the steps in this article, you need the following resources:
4545

4646
3. To start ingesting your streaming data into this database, select **Create** and give a name to your streaming job, and then select **Next: Input**.
4747

48-
![create Stream Analytics job](./media/stream-data-stream-analytics-integration/create-job.png)
48+
![configure Stream Analytics job basics](./media/stream-data-stream-analytics-integration/create-job.png)
4949

5050
4. Enter your events source details, and then select **Next: Output**.
5151

@@ -59,7 +59,7 @@ To complete the steps in this article, you need the following resources:
5959

6060
We recommend that you create a consumer group and a policy for each new Azure Stream Analytics job that you create from here. Consumer groups allow only five concurrent readers, so providing a dedicated consumer group for each job will avoid any errors that might arise from exceeding that limit. A dedicated policy allows you to rotate your key or revoke permissions without impacting other resources.
6161

62-
![create Stream Analytics job](./media/stream-data-stream-analytics-integration/create-job-output.png)
62+
![configure Stream Analytics job output](./media/stream-data-stream-analytics-integration/create-job-output.png)
6363

6464
5. Select which table you want to ingest your streaming data into. Once done, select **Create**.
6565

articles/stream-analytics/TOC.yml

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,34 @@
7373
- name: Outputs overview
7474
href: stream-analytics-define-outputs.md
7575
displayName: adls, sql, blob, event hubs, power bi, table, service bus, cosmos, functions
76-
- name: Output to Cosmos DB
77-
href: stream-analytics-documentdb-output.md
78-
- name: Output to Azure SQL DB
76+
- name: Azure Data Lake Storage Gen 1
77+
href: azure-data-lake-storage-gen1-output.md
78+
- name: Azure SQL Database
79+
href: sql-database-output.md
80+
- name: SQL Database performance
7981
href: stream-analytics-sql-output-perf.md
82+
- name: Azure Synapse Analytics
83+
href: azure-synapse-analytics-output.md
84+
- name: Blob storage & Azure Data Lake Gen 2
85+
href: blob-storage-azure-data-lake-gen2-output.md
8086
- name: Blob custom path patterns
8187
href: stream-analytics-custom-path-patterns-blob-storage-output.md
88+
- name: Event Hubs
89+
href: event-hubs-output.md
90+
- name: Power BI
91+
href: power-bi-output.md
92+
- name: Table storage
93+
href: table-storage-output.md
94+
- name: Service Bus queues
95+
href: service-bus-queues-output.md
96+
- name: Service Bus topics
97+
href: service-bus-topics-output.md
98+
- name: Azure Cosmos DB
99+
href: azure-cosmos-db-output.md
100+
- name: Cosmos DB optimization
101+
href: stream-analytics-documentdb-output.md
102+
- name: Azure Functions
103+
href: azure-functions-output.md
82104
- name: Extend queries with functions
83105
items:
84106
- name: Functions overview
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
---
2+
title: Azure Cosmos DB output from Azure Stream Analytics
3+
description: This article describes how to output data from Azure Stream Analytics to Azure Cosmos DB.
4+
author: mamccrea
5+
ms.author: mamccrea
6+
ms.reviewer: mamccrea
7+
ms.service: stream-analytics
8+
ms.topic: conceptual
9+
ms.date: 08/25/2020
10+
---
11+
12+
# Azure Cosmos DB output from Azure Stream Analytics
13+
14+
[Azure Cosmos DB](https://azure.microsoft.com/services/documentdb/) is a globally distributed database service that offers limitless elastic scale around the globe, rich query, and automatic indexing over schema-agnostic data models. To learn about Azure Cosmos DB container options for Stream Analytics, see the [Stream Analytics with Azure Cosmos DB as output](stream-analytics-documentdb-output.md) article.
15+
16+
Azure Cosmos DB output from Stream Analytics is currently not available in the Azure China 21Vianet and Azure Germany (T-Systems International) regions.
17+
18+
> [!Note]
19+
> Azure Stream Analytics only supports connection to Azure Cosmos DB by using the SQL API.
20+
> Other Azure Cosmos DB APIs are not yet supported. If you point Azure Stream Analytics to the Azure Cosmos DB accounts created with other APIs, the data might not be properly stored.
21+
22+
The following table describes the properties for creating an Azure Cosmos DB output.
23+
24+
| Property name | Description |
25+
| --- | --- |
26+
| Output alias | An alias to refer this output in your Stream Analytics query. |
27+
| Sink | Azure Cosmos DB. |
28+
| Import option | Choose either **Select Cosmos DB from your subscription** or **Provide Cosmos DB settings manually**.
29+
| Account ID | The name or endpoint URI of the Azure Cosmos DB account. |
30+
| Account key | The shared access key for the Azure Cosmos DB account. |
31+
| Database | The Azure Cosmos DB database name. |
32+
| Container name | The container name to be used, which must exist in Cosmos DB. Example: <br /><ul><li> _MyContainer_: A container named "MyContainer" must exist.</li>|
33+
| Document ID |Optional. The name of the field in output events that's used to specify the primary key on which insert or update operations are based.
34+
35+
## Partitioning
36+
37+
The partition key is based on the PARTITION BY clause in the query. The number of output writers follows the input partitioning for [fully parallelized queries](stream-analytics-scale-jobs.md). Stream Analytics converts the Cosmos DB output partition key to a string. For example, if you have a partition key with a value of 1 of type bigint, it is converted to "1" of type string.
38+
39+
## Output batch size
40+
41+
For the maximum message size, see [Azure Cosmos DB limits](../azure-resource-manager/management/azure-subscription-service-limits.md#azure-cosmos-db-limits). Batch size and write frequency are adjusted dynamically based on Azure Cosmos DB responses. There are no predetermined limitations from Stream Analytics.
42+
43+
## Next steps
44+
45+
* [Quickstart: Create a Stream Analytics job by using the Azure portal](stream-analytics-quick-create-portal.md)
46+
* [Quickstart: Create an Azure Stream Analytics job using the Azure CLI](quick-create-azure-cli.md)
47+
* [Quickstart: Create an Azure Stream Analytics job by using an ARM template](quick-create-azure-resource-manager.md)
48+
* [Quickstart: Create a Stream Analytics job using Azure PowerShell](stream-analytics-quick-create-powershell.md)
49+
* [Quickstart: Create an Azure Stream Analytics job by using Visual Studio](stream-analytics-quick-create-vs.md)
50+
* [Quickstart: Create an Azure Stream Analytics job in Visual Studio Code](quick-create-vs-code.md)
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
title: Azure Data Lake Storage Gen 1 output from Azure Stream Analytics
3+
description: This article describes Azure Data Lake Storage Gen 1 as an output option for Azure Stream Analytics.
4+
author: mamccrea
5+
ms.author: mamccrea
6+
ms.reviewer: mamccrea
7+
ms.service: stream-analytics
8+
ms.topic: conceptual
9+
ms.date: 08/25/2020
10+
---
11+
12+
# Azure Data Lake Storage Gen 1 output from Azure Stream Analytics
13+
14+
Stream Analytics supports [Azure Data Lake Storage Gen 1](../data-lake-store/data-lake-store-overview.md) outputs. Azure Data Lake Storage is an enterprise-wide, hyperscale repository for big data analytic workloads. You can use Data Lake Storage to store data of any size, type, and ingestion speed for operational and exploratory analytics. Stream Analytics needs to be authorized to access Data Lake Storage.
15+
16+
Azure Data Lake Storage output from Stream Analytics is not available in the Azure China 21Vianet and Azure Germany (T-Systems International) regions.
17+
18+
## Output configuration
19+
20+
The following table lists property names and their descriptions to configure your Data Lake Storage Gen 1 output.
21+
22+
| Property name | Description |
23+
| --- | --- |
24+
| Output alias | A friendly name used in queries to direct the query output to Data Lake Store. |
25+
| Subscription | The subscription that contains your Azure Data Lake Storage account. |
26+
| Account name | The name of the Data Lake Store account where you're sending your output. You're presented with a drop-down list of Data Lake Store accounts that are available in your subscription. |
27+
| Path prefix pattern | The file path that's used to write your files within the specified Data Lake Store account. You can specify one or more instances of the {date} and {time} variables:<br /><ul><li>Example 1: folder1/logs/{date}/{time}</li><li>Example 2: folder1/logs/{date}</li></ul><br />The time stamp of the created folder structure follows UTC and not local time.<br /><br />If the file path pattern doesn't contain a trailing slash (/), the last pattern in the file path is treated as a file name prefix. <br /><br />New files are created in these circumstances:<ul><li>Change in output schema</li><li>External or internal restart of a job</li></ul> |
28+
| Date format | Optional. If the date token is used in the prefix path, you can select the date format in which your files are organized. Example: YYYY/MM/DD |
29+
|Time format | Optional. If the time token is used in the prefix path, specify the time format in which your files are organized. Currently the only supported value is HH. |
30+
| Event serialization format | The serialization format for output data. JSON, CSV, and Avro are supported.|
31+
| Encoding | If you're using CSV or JSON format, an encoding must be specified. UTF-8 is the only supported encoding format at this time.|
32+
| Delimiter | Applicable only for CSV serialization. Stream Analytics supports a number of common delimiters for serializing CSV data. Supported values are comma, semicolon, space, tab, and vertical bar.|
33+
| Format | Applicable only for JSON serialization. **Line separated** specifies that the output is formatted by having each JSON object separated by a new line. If you select **Line separated**, the JSON is read one object at a time. The whole content by itself would not be a valid JSON. **Array** specifies that the output is formatted as an array of JSON objects. This array is closed only when the job stops or Stream Analytics has moved on to the next time window. In general, it's preferable to use line-separated JSON, because it doesn't require any special handling while the output file is still being written to.|
34+
| Authentication mode | You can authorize access to your Data Lake Storage account using [Managed Identity](stream-analytics-managed-identities-adls.md) or User token. Once you grant access, you can revoke access by changing the user account password, deleting the Data Lake Storage output for this job, or deleting the Stream Analytics job. |
35+
36+
## Partitioning
37+
38+
For the partition key, use {date} and {time} tokens in the path prefix pattern. Choose a date format, such as YYYY/MM/DD, DD/MM/YYYY, or MM-DD-YYYY. Use HH for the time format. The number of output writers follows the input partitioning for [fully parallelizable queries](stream-analytics-scale-jobs.md).
39+
40+
## Output batch size
41+
42+
For the maximum message size, see [Data Lake Storage limits](../azure-resource-manager/management/azure-subscription-service-limits.md#data-lake-store-limits). To optimize batch size, use up to 4 MB per write operation.
43+
44+
## Next steps
45+
46+
* [Quickstart: Create a Stream Analytics job by using the Azure portal](stream-analytics-quick-create-portal.md)
47+
* [Quickstart: Create an Azure Stream Analytics job using the Azure CLI](quick-create-azure-cli.md)
48+
* [Quickstart: Create an Azure Stream Analytics job by using an ARM template](quick-create-azure-resource-manager.md)
49+
* [Quickstart: Create a Stream Analytics job using Azure PowerShell](stream-analytics-quick-create-powershell.md)
50+
* [Quickstart: Create an Azure Stream Analytics job by using Visual Studio](stream-analytics-quick-create-vs.md)
51+
* [Quickstart: Create an Azure Stream Analytics job in Visual Studio Code](quick-create-vs-code.md)
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
---
2+
title: Azure Functions output from Azure Stream Analytics
3+
description: This article describes Azure functions as output for Azure Stream Analytics.
4+
author: mamccrea
5+
ms.author: mamccrea
6+
ms.reviewer: mamccrea
7+
ms.service: stream-analytics
8+
ms.topic: conceptual
9+
ms.date: 08/25/2020
10+
---
11+
12+
# Azure Functions output from Azure Stream Analytics
13+
14+
Azure Functions is a serverless compute service that you can use to run code on-demand without having to explicitly provision or manage infrastructure. It lets you implement code that's triggered by events occurring in Azure or partner services. This ability of Azure Functions to respond to triggers makes it a natural output for Azure Stream Analytics. This output adapter enables users to connect Stream Analytics to Azure Functions, and run a script or piece of code in response to a variety of events.
15+
16+
Azure Functions output from Stream Analytics is currently not available in the Azure China 21Vianet and Azure Germany (T-Systems International) regions.
17+
18+
Azure Stream Analytics invokes Azure Functions via HTTP triggers. The Azure Functions output adapter is available with the following configurable properties:
19+
20+
| Property name | Description |
21+
| --- | --- |
22+
| Function app |The name of your Azure Functions app. |
23+
| Function |The name of the function in your Azure Functions app. |
24+
| Key |If you want to use an Azure Function from another subscription, you can do so by providing the key to access your function. |
25+
| Max batch size |A property that lets you set the maximum size for each output batch that's sent to your Azure function. The input unit is in bytes. By default, this value is 262,144 bytes (256 KB). |
26+
| Max batch count |A property that lets you specify the maximum number of events in each batch that's sent to Azure Functions. The default value is 100. |
27+
28+
Azure Stream Analytics expects HTTP status 200 from the Functions app for batches that were processed successfully.
29+
30+
When Azure Stream Analytics receives a 413 ("http Request Entity Too Large") exception from an Azure function, it reduces the size of the batches that it sends to Azure Functions. In your Azure function code, use this exception to make sure that Azure Stream Analytics doesn't send oversized batches. Also, make sure that the maximum batch count and size values used in the function are consistent with the values entered in the Stream Analytics portal.
31+
32+
> [!NOTE]
33+
> During test connection, Stream Analytics sends an empty batch to Azure Functions to test if the connection between the two works. Make sure that your Functions app handles empty batch requests to make sure test connection passes.
34+
35+
Also, in a situation where there's no event landing in a time window, no output is generated. As a result, the **computeResult** function isn't called. This behavior is consistent with the built-in windowed aggregate functions.
36+
37+
## Partitioning
38+
39+
The partition key is based on the PARTITION BY clause in the query. The number of output writers follows the input partitioning for [fully parallelized queries](stream-analytics-scale-jobs.md).
40+
41+
## Output batch size
42+
43+
The default batch size is 262,144 bytes (256 KB). The default event count per batch is 100. The batch size is configurable and can be increased or decreased in the Stream Analytics output options.
44+
45+
## Next steps
46+
47+
* [Quickstart: Create a Stream Analytics job by using the Azure portal](stream-analytics-quick-create-portal.md)
48+
* [Quickstart: Create an Azure Stream Analytics job using the Azure CLI](quick-create-azure-cli.md)
49+
* [Quickstart: Create an Azure Stream Analytics job by using an ARM template](quick-create-azure-resource-manager.md)
50+
* [Quickstart: Create a Stream Analytics job using Azure PowerShell](stream-analytics-quick-create-powershell.md)
51+
* [Quickstart: Create an Azure Stream Analytics job by using Visual Studio](stream-analytics-quick-create-vs.md)
52+
* [Quickstart: Create an Azure Stream Analytics job in Visual Studio Code](quick-create-vs-code.md)
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
title: Azure Synapse Analytics output from Azure Stream Analytics
3+
description: This article describes Azure Synapse Analytics as output for Azure Stream Analytics.
4+
author: mamccrea
5+
ms.author: mamccrea
6+
ms.reviewer: mamccrea
7+
ms.service: stream-analytics
8+
ms.topic: conceptual
9+
ms.date: 08/25/2020
10+
---
11+
12+
# Azure Synapse Analytics output from Azure Stream Analytics (Preview)
13+
14+
[Azure Synapse Analytics](https://azure.microsoft.com/services/synapse-analytics) (formerly SQL Data Warehouse) is a limitless analytics service that brings together enterprise data warehousing and Big Data analytics.
15+
16+
Azure Stream Analytics jobs can output to a SQL pool table in Azure Synapse Analytics and can process throughput rates up to 200MB/sec. This supports the most demanding real-time analytics and hot-path data processing needs for workloads such as reporting and dashboarding.
17+
18+
The SQL pool table must exist before you can add it as output to your Stream Analytics job. The table's schema must match the fields and their types in your job's output.
19+
20+
To use Azure Synapse as output, you need to ensure that you have the storage account configured. Navigate to Storage account settings to configure the storage account. Only the storage account types that support tables are permitted: General-purpose V2 and General-purpose V1. Select Standard Tier only. Premium tier is not supported.
21+
22+
## Output configuration
23+
24+
The following table lists the property names and their descriptions for creating am Azure Synapse Analytics output.
25+
26+
|Property name|Description|
27+
|-|-|
28+
|Output alias |A friendly name used in queries to direct the query output to this database. |
29+
|Database |SQL pool name where you're sending your output. |
30+
|Server name |Azure Synapse server name. |
31+
|Username |The username that has write access to the database. Stream Analytics supports only SQL authentication. |
32+
|Password |The password to connect to the database. |
33+
|Table | The table name where the output is written. The table name is case-sensitive. The schema of this table should exactly match the number of fields and their types that your job output generates.|
34+
35+
## Next steps
36+
37+
* [Quickstart: Create a Stream Analytics job by using the Azure portal](stream-analytics-quick-create-portal.md)
38+
* [Quickstart: Create an Azure Stream Analytics job using the Azure CLI](quick-create-azure-cli.md)
39+
* [Quickstart: Create an Azure Stream Analytics job by using an ARM template](quick-create-azure-resource-manager.md)
40+
* [Quickstart: Create a Stream Analytics job using Azure PowerShell](stream-analytics-quick-create-powershell.md)
41+
* [Quickstart: Create an Azure Stream Analytics job by using Visual Studio](stream-analytics-quick-create-vs.md)
42+
* [Quickstart: Create an Azure Stream Analytics job in Visual Studio Code](quick-create-vs-code.md)

0 commit comments

Comments
 (0)