Is there a way to ingest data from an Azure IoT hub to a MySQL database? - azure

I am trying to get data from my Azure IoT hub to a database, which will be then displayed on a website.
I have seen many ways to ingest data such as azure data explorer cluster and stream analytics jobs. However, the issue i have with data explorer is that i cannot get connection details for the database so i cot connect to it using code. As for stream analytics jobs, MySQL databases are not supported, and I have only have experience with MySQL.
Does anyone know a way i can ingest data from my Azure IoT hub to a MySQL database? Thanks in advance.

You will have to write some code to do this.
You can for instance create an Azure Function that uses an IoTHubTrigger or EventHubTrigger so that the Function receives the messages that are available on the IoT Hub. In the Function, you write code to make sure that the data is inserted in the appropriate tables in your database.
Find some documentation regarding this here.

Related

Is there a way to get sensor data from IoT central a MySQL database?

I created simulated sensors that send the data heartrate, blood pressure and temperature. However, I am not sure how to send this data to a MySQL database. I believe that one of the ways I can do it is use Azure functions to send the data, but I am not sure how to go about it. Can anyone help?
Welcome to the community! You can achieve your use case with the following steps.
Push data from Azure IoT Central to an Azure cloud end point such as Event Hub or Service Bus. Here are the supported cloud destinations.
Note If this is a mockup project and you are using MySQL database for testing, I would recommend going with Azure Data Explorer instead. It will eliminate the need for next two steps if you decide to go with Export to Azure Data Explorer. If you still would like to use MySQL database, go with either of the following options-- a) Export to Service Bus b) Export to Event Hubs
Create an Azure Trigger function based on your cloud end point.
a) Azure Event Hubs trigger for Azure Functions
b) Azure Service Bus trigger for Azure Functions
Within this function, you can write custom code based on the coding language you choose to push data to MySQL database. Here is a reference tutorial that pushes data from Azure Functions to Azure SQL DB -- Azure SQL output binding for Azure Functions

From Azure Stream Analytics to Power Bi Desktop

I have done some research on my own, but cant seem to find a solution. We have an IoT solution in Azure. We are gathering real-time streaming data from sensors to Azure IoT HUB. This data is getting sent to Azure Stream Analytics and through Azure functions we will display the data in Power Bi. This works for us so far, but we want the real-time streaming data not only in browser mode but also in Power BI desktop. Since the desktop has way more functionalities this is important. Does anybody have any input on this?
We have tried what I described
You need to output the data from Stream Analytics to some kind of data store, like Azure SQL Database, Cosmos DB, etc. Then you can connect your PowerBI Desktop to that datastore.

Data flow: Azure Event Hubs to Cosmos db VS Cosmos db to Azure Event Hub - Better option?

I want to monitor some events coming from my application.
One option is to send data to Azure Event Hub and use stream analytics to do some post-processing and enter the data into cosmos db.
Another option is to store to cosmos db from application and run a periodic azure function to do the processing and store it back.
What is the right way to do it? Is there a better way to do it?
The best architecture way is to have Event Hubs to Cosmos DB. I have done the same implementations using Application -> EventHub -> ChangeFeed Azure Function -> Cosmosdb
You can read about Here.
ChangeFeed is offered by Azure Cosmos DB out of the box for this case. It works as a trigger on Cosmos DB change.
It depends on the kind of processing that you would like to do with the events ingested. If it is event at a time processing, a simple Azure Function with CosmosDB changefeed processor might be enough. If you would like to do stateful processing like windowing or event order based computation, azure Stream Analytics would be better. Stream Analytics also provides native integration to PowerBI dashboards. Same job can send the data both to CosmosDB and PowerBI. If you are going to use Azure Stream Analytics, you will have to use EventHub for event ingestion. Using EventHub for ingestion also has other benefits like being able to archive events to blob storage.

Connect Stream Analytics to Azure Postgres - Possible?

Getting error messages. Seems this is not possible ?
message is :
The JSON provided in the request body is invalid. Property 'server' value 'postgres-mydatabase123.postgres.database.azure.com' is not acceptable.
According to the documentation this is not possible as currently the support output sinks are
Azure Data Lake Store
SQL Database Blob storage
Event Hub
Power BI
Table Storage
Service Bus Queues
Service Bus Topics
Azure Cosmos DB
Azure Functions (In Preview)
Out of all of these Azure Functions or Event Hub might be interesting to you as they allow custom code to process the data. In your case that would be sending it to the PostgreSQL database.

is there a way to write stream analytics output to Azure documentdb

I am developing an application . I am pushing data to event hub .From event hub i need to use stream analytics and push data to DOcumentdb for analytics purpose. Could any one please guide me to push data from stream analytics to documentdb. I could see output to SQL Database,Blob storage,Event Hub,Power BI preview,Table storage, Service Bus Queue, Service Bus Topic only
Edit: this feature is now implemented, and DocumentDB can be used as a sink for Stream Analytics: http://blogs.msdn.com/b/streamanalytics/archive/2015/09/29/stream-analytics-updates-for-the-azure-iot-suite.aspx
Yes this effort has already been started while ago as per the feedback forum and it should be publicly available soon. Please share more feedback about your scenario over there and maybe why Azure Table or SQL output are not satisfying it.
thanks!

Resources