2

In my project I receive data from Azure IoThub and want to send it to a SQL database using Azure stream analytics. I'm trying to achieve this using the following query:

SELECT
    IoTDataArrayElement.ArrayValue.sProjectID AS id
INTO
    [test-machine]
FROM
    [iothub-input] AS e
CROSS APPLY GetArrayElements(e.iotdata) AS IoTDataArrayElement
HAVING IoTDataArrayElement.ArrayValue IS NOT NULL

When I run the query in the environment provided by stream analytics and press test query I get the expected output which is a projectID. But when I start the stream analytics job the data doesn't go in to my database table. The table has 1 column 'id'.

When I try to send all the data to a blob storage the stream analytics job works.

Can someone please explain to me why the query I use for sending the data to a database doesn't actually send the data to a database?

2
  • is the column type in the database compatible? Does the db firewall allow connections from ASA? Commented Oct 14, 2019 at 11:00
  • @silent Thanks for the comment, The db does allow connections from ASA and the columnh type in the database is compatible Commented Oct 14, 2019 at 11:03

2 Answers 2

3

Couple of things you need to verify to make successfully configuration of Azure SQL DB as output:

  • Make sure firewall settings is ON for All Azure Services.

enter image description here

  • Make sure you have configured the output to the sql database with the correct properties defined.

The following table lists the property names and their description for creating a SQL Database output.

enter image description here

  • Make sure the table schema must exactly match the fields and their types in your job's output.

Hope this helps.

Sign up to request clarification or add additional context in comments.

2 Comments

I found out that it is hard to store data from asa to a relational database. So i decided to write a azure function wich i now use as a output. The functions takes care of the data and de placements in the correct tables.
@Collin Would you like you post that as an answer so you can mark this question as answered?
0

Having battled a seemingly similar issue for quite a while, i found that Asure Stream Analytics uses TLS1.0 when connecting to an SQL Database, but not while testing the connection. This resulted in having to change the security settings for my Azure SQL database.

Also see @CHEEKATLAPRADEEP's answer, as this also applies.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.