Send data to Microsoft Azure

How can I send some value that I am getting in node red to the AZURE cloud? I am trying it with a SQL database but I don´t get it.

You would need to tell us more about how you have Azure set up. Are you running Azure SQL as IaaS or PaaS for example?

Generally though, if you want a direct database connection (rather than running through an intermediate REST API), you will need to know the IP name/address of the server, have configured the server to allow a connection from you and will need the authentication details. There are several ways that this can be configured.

What nodes are you using? What is your flow?

azure
This is the node that I am using and I complete everything that the Azure SQl node asks to write

Take a look at the readme for the azure node you are using which contains an example of how to write to the database.

If the format of your data is correct for the dashboard it won’t be correct for your azure node. You haven’t told azure node where you want to store the data.

I already read the readme of that node but i don´t know what to do exactly , I didn´t understand the readme correctly.

Ex: msg.payload -> { "action": "I", "query": "insert into table (Name, LastName, Age) VALUES ('Jane', 'Doe', '25')" };

i.e.
msg.payload={ "action": "I", "query": "insert into table (Name, LastName, Age) VALUES ('Jane', 'Doe', '25')" };

Add a debug node after your [production] node and compare your msg payload to the above.
( if you get stuck always add a debug node to see what the message looks like)

But to understand the msg.payload part you need to understand a bit about SQL queries. There are lots of tutorials online which will explain how to work with SQL.

But this does all depend on you wanting to add data into a SQL database in Azure is that correct?

[Production] is giving just numbers.
Yes, I want to see in azure what values am I getting, it doesn´t matter how but I need to get that

but where in Azure?


Azure contains many different applications of which one is a SQL Database (see image)

If you want the data in the Azure SQL Database you are using the right node. If you want it in something else inside of Azure you are using the wrong node.

Assuming you do want to use Azure SQL Database then you have to have configured the database by setting up tables, columns etc. (There are numerous tutorials online that explain this)

When you have done that, when you send data to a database you need to tell the database what data you have and where you want it stored. Which is what the line msg.payload={ "action": "I", "query": "insert into table (Name, LastName, Age) VALUES ('Jane', 'Doe', '25')" }; does.

You would need to do somethings similar with your data, the easiest is probably in a function node between your [production] node and you [azure sql] node.

I will try to do it again waching more tutorials because i don´t get it right

Which bit?

  1. Do you want to use Azure SQL?

  2. Have you setup the SQL database in Microsoft Azure?

  3. Have you tried coding a function node to send data in the correct format to Azure?

yes I want to use Azure SQL and I have already setup the SQL but I haven´t codified the function node because I don´t know how to do it.

So the debug you added gives a number? And I'm guessing you are trying to insert one value and a timestamp to the database?

so most of teh example is a copy and paste

msg.payload={ "action": "I", "query": "insert into table <--- you want to insert
(Name, LastName, Age) <-- the column names
VALUES ('Jane', 'Doe', '25')" }; <-- the values

But as in your case the value is coming from the message you will need to reference msg.payload. see this thread Need Help to Insert, Update and Delete Data from Node-RED Dashboard Inputs to the Database - #34 by tarihoran20