Defining Azure Stream Analytics iot-hub input source through Powershell RRS feed

  • Question

  • I'm trying to write a powershell script that creates a new streamAnalytics job in my azure portal account, with input source as iot-hub and output source as blob storage account.

    To do so, I'm using AzureRM command new-streamAnalyticsJob, and json files.

    my problem is: I have not seen any documentation or example for json file where the inputs source is iot-hub. only event-hub.

    what are the parameters I need to give in the json file? can anyone display an example for json file with input source to streamAnalytics job as Iot-hub?

    Thursday, June 1, 2017 7:33 PM

All replies

  • Hi,

    The “datasource” property would look something like this:


    "datasource": {

          "type": "Microsoft.Devices/IotHubs",

          "properties": {

            "iotHubNamespace": "[TBDIotHubNamespace]",

                  "sharedAccessPolicyName": "[TBDIotHubPolicyName]",

                  "sharedAccessPolicyKey": "[TBDIotHubPolicyKey]",

                  "consumerGroupName" : "[TBDIotHubConsumerGroupName]",

                  "endpoint" : "[TBDIotHubEndpoint]"




    You can find an example of a REST API request/response below for creating an IoT Hub input:



    Let us know if you have any question.


    Wednesday, June 7, 2017 4:42 AM