Skip to content

Commit

Permalink
Merge pull request #10636 from jeffstokes72/master
Browse files Browse the repository at this point in the history
Update 2 articles
  • Loading branch information
rmca14 committed May 6, 2015
2 parents f52dc69 + d613f89 commit 910c1f6
Show file tree
Hide file tree
Showing 4 changed files with 251 additions and 39 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions articles/stream-analytics-introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
ms.topic="article"
ms.tgt_pltfrm="na"
ms.workload="data-services"
ms.date="04/24/2015"
ms.date="05/06/2015"
ms.author="jeffstok"/>


Expand All @@ -24,9 +24,9 @@ Azure Stream Analytics is a fully managed service providing low-latency, highly

## Introduction to Azure Stream Analytics (video)

In this video, Santosh Balasubramanian and Scott Hanselman introduce Azure Stream Analytics. (Duration: 11:22)
In this [video](http://azure.microsoft.com/documentation/videos/introduction-to-azure-stream-analytics-with-santosh-balasubramanian/), Santosh Balasubramanian and Scott Hanselman introduce Azure Stream Analytics. (Duration: 11:22)

> [AZURE.VIDEO introduction-to-azure-stream-analytics-with-santosh-balasubramanian]
> [AZURE.VIDEO introduction-to-azure-stream-analytics-with-santosh-balasubramanian]
## Motivation & overview

Expand Down
171 changes: 171 additions & 0 deletions articles/stream-analytics-monitor-jobs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
<properties
pageTitle="Stream Analytics Monitor Jobs | Azure"
description="How to: Monitor Stream Analytics Jobs Programatically."
services="stream-analytics"
documentationCenter=""
authors="jeffstokes72"
manager="paulettm"
editor="cgronlun"/>

<tags
ms.service="stream-analytics"
ms.devlang="na"
ms.topic="article"
ms.tgt_pltfrm="na"
ms.workload="data-services"
ms.date="05/06/2015"
ms.author="jeffstok"/>


# How to: Monitor Stream Analytics Jobs Programatically
This article shows demonstrates how to enable monitoring for a Stream Analytics job. Stream Analytics jobs created via REST APIs, Azure SDK, or Powershell do not have monitoring enabled by default. You can manually enable this in the Azure Portal by navigating to the job’s Monitor page and clicking the Enable button or you can automate this process by following the steps in this article. The monitoring data will show up in the “Monitor” tab in the Azure Portal for your Stream Analytics job.

![Monitor Jobs Tab](./media/stream-analytics-monitor-jobs/stream-analytics-monitor-jobs-tab.png)

## Prerequisites
Before you begin this article, you must have the following:

- Visual Studio 2012 or 2013.
- Download and install [Azure .NET SDK](http://azure.microsoft.com/downloads/).
- An existing Stream Analytics job that needs monitoring enabled.

## Setup a project

1. Create a Visual Studio C# .Net console application.
2. In the Package Manager Console, run the following commands to install the NuGet packages. The first one is the Azure Stream Analytics Management .NET SDK. The second one is the Azure Insights SDK which will be used to enable monitoring. The last one is the Azure Active Directory client that will be used for authentication.

```
Install-Package Microsoft.Azure.Management.StreamAnalytics –Pre
Install-Package Microsoft.Azure.Insights -Pre
Install-Package Microsoft.IdentityModel.Clients.ActiveDirectory
```

3. Add the following appSettings section to the App.config file.

```
<appSettings>
<!--CSM Prod related values-->
<add key="ActiveDirectoryEndpoint" value="https://login.windows-ppe.net/" />
<add key="ResourceManagerEndpoint" value="https://api-current.resources.windows-int.net/" />
<add key="WindowsManagementUri" value="https://management.core.windows.net/" />
<add key="AsaClientId" value="1950a258-227b-4e31-a9cf-717495945fc2" />
<add key="RedirectUri" value="urn:ietf:wg:oauth:2.0:oob" />
<add key="SubscriptionId" value="<YOUR AZURE SUBSCRIPTION ID>" />
<add key="ActiveDirectoryTenantId" value="YOUR TENANT ID" />
</appSettings>
```
Replace values for *SubscriptionId* and *ActiveDirectoryTenantId* with your Azure subscription and tenant IDs. You can get these values by running the following PowerShell cmdlet:

```
Get-AzureAccount
```
4. Add the following using statements to the source file (Program.cs) in the project.

```
using System;
using System.Configuration;
using System.Threading;
using Microsoft.Azure;
using Microsoft.Azure.Management.Insights;
using Microsoft.Azure.Management.Insights.Models;
using Microsoft.Azure.Management.StreamAnalytics;
using Microsoft.Azure.Management.StreamAnalytics.Models;
using Microsoft.IdentityModel.Clients.ActiveDirectory;
```
5. Add an authentication helper method.

public static string GetAuthorizationHeader()
{
AuthenticationResult result = null;
var thread = new Thread(() =>
{
try
{
var context = new AuthenticationContext(
ConfigurationManager.AppSettings["ActiveDirectoryEndpoint"] +
ConfigurationManager.AppSettings["ActiveDirectoryTenantId"]);

result = context.AcquireToken(
resource: ConfigurationManager.AppSettings["WindowsManagementUri"],
clientId: ConfigurationManager.AppSettings["AsaClientId"],
redirectUri: new Uri(ConfigurationManager.AppSettings["RedirectUri"]),
promptBehavior: PromptBehavior.Always);
}
catch (Exception threadEx)
{
Console.WriteLine(threadEx.Message);
}
});

thread.SetApartmentState(ApartmentState.STA);
thread.Name = "AcquireTokenThread";
thread.Start();
thread.Join();

if (result != null)
{
return result.AccessToken;
}

throw new InvalidOperationException("Failed to acquire token");
}

## Create Management Clients
The following code will set up the necessary variables and management clients.

string resourceGroupName = "<YOUR AZURE RESOURCE GROUP NAME>";
string streamAnalyticsJobName = "<YOUR STREAM ANALYTICS JOB NAME>";

// Get authentication token
TokenCloudCredentials aadTokenCredentials =
new TokenCloudCredentials(
ConfigurationManager.AppSettings["SubscriptionId"],
GetAuthorizationHeader());

Uri resourceManagerUri = new
Uri(ConfigurationManager.AppSettings["ResourceManagerEndpoint"]);

// Create Stream Analytics and Insights management client
StreamAnalyticsManagementClient streamAnalyticsClient = new
StreamAnalyticsManagementClient(aadTokenCredentials, resourceManagerUri);
InsightsManagementClient insightsClient = new
InsightsManagementClient(aadTokenCredentials, resourceManagerUri);

## Enable Monitoring For an Existing Stream Analytics Job

The following code will enable monitoring for an **existing** Stream Analytics job. The first part of the code performs a GET request against the Stream Analytics service to retrieve information about the particular Stream Analytics job. It uses the “Id” property (retrieved from the GET request) as a parameter for the Put method in the second half of the code which sends a PUT request to the Insights service to enable monitoring for the Stream Analytics job.

> [AZURE.WARNING] If you have previously enabled monitoring for a different Stream Analytics job, either through the Azure Portal or programmatically via the below code, **it is recommended that you provide the same storage account name that you did when you previously enabled monitoring.**
The storage account is linked to the region you created your Stream Analytics job in, not specifically to the job itself. All Stream Analytics job (and all other Azure resources) in that same region share this storage account to store monitoring data. If you provide a different storage account, it may cause unintended side effects to the monitoring of your other Stream Analytics jobs and/or other Azure resources.
The storage account name used to replace ```“<YOUR STORAGE ACCOUNT NAME>”``` below should be a storage account that is in the same subscription as the Stream Analytics job you are enabling monitoring for?

// Get an existing Stream Analytics job
JobGetParameters jobGetParameters = new JobGetParameters()
{
PropertiesToExpand = "inputs,transformation,outputs"
};
JobGetResponse jobGetResponse = streamAnalyticsClient.StreamingJobs.Get(resourceGroupName, streamAnalyticsJobName, jobGetParameters);

// Enable monitoring
ServiceDiagnosticSettingsPutParameters insightPutParameters = new ServiceDiagnosticSettingsPutParameters()
{
Properties = new ServiceDiagnosticSettings()
{
StorageAccountName = "<YOUR STORAGE ACCOUNT NAME>"
}
};
insightsClient.ServiceDiagnosticSettingsOperations.Put(jobGetResponse.Job.Id, insightPutParameters);



## Get support
For further assistance, try our [Azure Stream Analytics forum](https://social.msdn.microsoft.com/Forums/en-US/home?forum=AzureStreamAnalytics).


## Next steps

- [Introduction to Azure Stream Analytics](stream-analytics-introduction.md)
- [Get started using Azure Stream Analytics](stream-analytics-get-started.md)
- [Scale Azure Stream Analytics jobs](stream-analytics-scale-jobs.md)
- [Azure Stream Analytics Query Language Reference](https://msdn.microsoft.com/library/azure/dn834998.aspx)
- [Azure Stream Analytics Management REST API Reference](https://msdn.microsoft.com/library/azure/dn835031.aspx)
113 changes: 77 additions & 36 deletions articles/stream-analytics-release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,44 +13,85 @@
ms.topic="article"
ms.tgt_pltfrm="na"
ms.workload="data-services"
ms.date="04/24/2015"
ms.date="05/06/2015"
ms.author="jeffstok"/>

#Delay in Azure Storage account configuration

When creating a Stream Analytics job in a region for the first time, you will be prompted to create a new Storage account or specify an existing account for monitoring Stream Analytics jobs in that region. Due to latency in configuring monitoring, creating another Stream Analytics job in the same region within 30 minutes will prompt for the specifying of a second Storage account instead of showing the recently configured one in the Monitoring Storage Account drop-down. To avoid creating an unnecessary Storage account, wait 30 minutes after creating a job in a region for the first time before provisioning additional jobs in that region.

##Job upgrade

At this time, Stream Analytics does not support live edits to the definition or configuration of a running job. In order to change the input, output, query, scale or configuration of a running job, you must first stop the job.

##Data types inferred from input source

If a **CREATE TABLE** statement is not used, the input type is derived from input format, for example all fields from CSV are string. Fields need to be converted explicitly to the right type using the CAST function in order to avoid type mismatch errors.

##Missing fields are outputted as null values

Referencing a field that is not present in the input source will result in null values in the output event.

##WITH statements must precede SELECT statements

In your query, SELECT statements must follow subqueries defined in WITH statements.

##Out-of-memory issue

Streaming Analytics jobs with a large tolerance for out-of-order events and/or complex queries maintaining a large amount of state may cause the job to run out of memory, resulting in a job restart. The start and stop operations will be visible in the job’s operation logs. To avoid this behavior, scale the query out across multiple partitions. In a future release, this limitation will be addressed by degrading performance on impacted jobs instead of restarting them.

##Large blob inputs without payload timestamp may cause Out-of-memory issue

Consuming large files from Blob storage may cause Stream Analytics jobs to crash if a timestamp field is not specified via TIMESTAMP BY. To avoid this issue, keep each blob under 10MB in size.

##SQL Database event volume limitation

When using SQL Database as an output target, very high volumes of output data may cause the Stream Analytics job to time out. To resolve this issue, either reduce the output volume by using aggregates or filter operators, or choose Azure Blob storage or Event Hubs as an output target instead.

##PowerBI datasets can only contain one table

PowerBI does not support more than one table in a given dataset.
#Microsoft Stream Analytic release notes

## Notes for 05/03/2015 release of Stream Analytics ##

This release contains the following updates.

<table border="1">
<tr>
<th>Title</th>
<th>Description</th>
</tr>

<tr>
<td>Increased maximum value for Out of Order Tolerance Window</td>
<td>The maximum size for the Out of Order Tolerance Window is now 59:59 (MM:SS)</td>
</tr>

<tr>
<td>JSON Output Format: Line Separated or Array</td>
<td>Now there is an option when outputting to Blob Storage or Event Hub to output as either an array of JSON objects or by separating JSON objects with a new line. </td>
</tr>
</table>

## Notes for 04/16/2015 release of Stream Analytics ##

<table border="1">
<tr>
<th>Title</th>
<th>Description</th>
</tr>

<tr>
<td>Delay in Azure Storage account configuration</td>
<td>When creating a Stream Analytics job in a region for the first time, you will be prompted to create a new Storage account or specify an existing account for monitoring Stream Analytics jobs in that region. Due to latency in configuring monitoring, creating another Stream Analytics job in the same region within 30 minutes will prompt for the specifying of a second Storage account instead of showing the recently configured one in the Monitoring Storage Account drop-down. To avoid creating an unnecessary Storage account, wait 30 minutes after creating a job in a region for the first time before provisioning additional jobs in that region.</td>
</tr>

<tr>
<td>Job Upgrade</td>
<td>At this time, Stream Analytics does not support live edits to the definition or configuration of a running job. In order to change the input, output, query, scale or configuration of a running job, you must first stop the job.</td>
</tr>

<tr>
<td>Data types inferred from input source</td>
<td>If a CREATE TABLE statement is not used, the input type is derived from input format, for example all fields from CSV are string. Fields need to be converted explicitly to the right type using the CAST function in order to avoid type mismatch errors.</td>
</tr>

<tr>
<td>Missing fields are outputted as null values</td>
<td>Referencing a field that is not present in the input source will result in null values in the output event.</td>
</tr>

<tr>
<td>WITH statements must precede SELECT statements</td>
<td>In your query, SELECT statements must follow subqueries defined in WITH statements.</td>
</tr>

<tr>
<td>Out-of-memory issue</td>
<td>Streaming Analytics jobs with a large tolerance for out-of-order events and/or complex queries maintaining a large amount of state may cause the job to run out of memory, resulting in a job restart. The start and stop operations will be visible in the job’s operation logs. To avoid this behavior, scale the query out across multiple partitions. In a future release, this limitation will be addressed by degrading performance on impacted jobs instead of restarting them.</td>
</tr>

<tr>
<td>Large blob inputs without payload timestamp may cause Out-of-memory issue</td>
<td>Consuming large files from Blob storage may cause Stream Analytics jobs to crash if a timestamp field is not specified via TIMESTAMP BY. To avoid this issue, keep each blob under 10MB in size.</td>
</tr>

<tr>
<td>SQL Database event volume limitation</td>
<td>When using SQL Database as an output target, very high volumes of output data may cause the Stream Analytics job to time out. To resolve this issue, either reduce the output volume by using aggregates or filter operators, or choose Azure Blob storage or Event Hubs as an output target instead.</td>
</tr>

<tr>
<td>PowerBI datasets can only contain one table</td>
<td>PowerBI does not support more than one table in a given dataset.</td>
</tr>
</table>

## Get help
For further assistance, try our [Azure Stream Analytics forum](https://social.msdn.microsoft.com/Forums/en-US/home?forum=AzureStreamAnalytics)
Expand Down

0 comments on commit 910c1f6

Please sign in to comment.