How to use configuration data in Azure Stream Analytics Job?

55 views Asked by At

I have a Stream Analytics job streaming data from an EventHub. The job makes use of multiple Javascript functions to perform some calculations. I would like to pass in some configuration (preferrably JSON from Blob Storage) to those functions. Is there any way to do this?

I could read the configuration from Blob Storage as reference data input but I don't want to join the config (JSON) with thousands of input rows from the event hub as that becomes extremely inefficient. I just want to fecth a single config object and pass it into the functions.

Any ideas?

SomeData AS (  
    SELECT
        Data, 
        UDF.PerformSomeCalculations(Data.Cars, Data.Trains, ConfigFromBlob) AS ProcessedData,
    FROM DataFromPreviousStep
)
1

There are 1 answers

0
Florian Eiden On

UDF can only access data from inputs (streaming or reference) via the data plane. You will need to use joins if you want to go this route.

From a UDF, you won't be able to call external resources. So there really is no other way to pass configuration data other than re-starting the job with a new UDF definition.