Search code examples
azureazure-application-insightsazure-stream-analytics

How can I use Azure Stream Analytics to use an on-premise SQL Server as an Output?


I'm following the instructions to set up App Insights to spool to SQL using Azure Stream Analytics, but I'm trying to deviate slightly to use an on-premise SQL server (that the web application already uses) over VPN.

At the point of adding the output, this is failing with:

The JSON provided in the request body is invalid. Property 'server' value '' is not acceptable

Is it the case that IP addresses are not supported, or is it something more fundamental than that?


Solution

  • You are probably looking for answers directly to your question, which Jean-Sébastien answers succinctly. But an alternative architecture, if you haven't considered it already...

    You could stream to a transient Azure SQL Database or Blob storage (likely cheaper depending on your workload), and then use Azure Data Factory tunnelled via a Self-Hosted Data Factory Integration Runtime to "send" the data back to on-premise SQL.

    Data Factory V2 also has blob triggers, so rather than needing a schedule it could pickup any new blobs in micro batches.

    I say "send" in quotation marks as the Integration Runtime actually creates an outgoing connection to from on-premise to Azure, yet gives the capability for push-like data transfer.

    If data factory proves useful, here is a guide creating copy pipelines: https://learn.microsoft.com/en-us/azure/data-factory/tutorial-hybrid-copy-portal

    Albeit this guide is for on-prem sql to blob, but it gives you a stronger starting point.