0
votes

The azure-eventhub (1.3.2) lib for python only allows users to send and consume messages from Azure EventHub.

Use the Event Hubs client library for Python to:

  • Publish events to the Event Hubs service through a sender.

  • Read events from the Event Hubs service through a receiver.

For conception and debugging purposes, I tried using the querying console available on the Azure portal but the experience was... unproductive (multiple crashes, reloads, etc.). Is there a way to execute steaming analytics queries from python code?

Example query:

SELECT
    [event],
    DATEDIFF(...)
INTO
    [Output]
FROM
    [input] TIMESTAMP BY Time
2

2 Answers

1
votes

There is no python sdk for azure stream analytics.

If you have to use python, you can try to use python call related powershell script for your purpose.

Here is an example of how to use python call powershell.

0
votes

Unfortunately, Azure Stream Analytics doesn't support queries from a python script.

Queries in Azure Stream Analytics are expressed in a SQL-like query language. The language constructs are documented in the Stream Analytics query language reference guide.

The query design can express simple pass-through logic to move event data from one input stream into an output data store, or it can do rich pattern matching and temporal analysis to calculate aggregates over various time windows as in the Build an IoT solution by using Stream Analytics guide. You can join data from multiple inputs to combine streaming events, and you can do lookups against static reference data to enrich the event values. You can also write data to multiple outputs.

For more details, refer "Query examples for common Stream Analytics usage patterns".

Hope this helps.