There are not good samples available for JSON files to create Stream Analytics Jobs. Here are sample which can form input to PowerShell cmdlet.
New-AzureStreamAnalyticsJob -ResourceGroupName <Any name> -File <Json file name> -Name <Stream Analytics Job Name>
Here is the Json file that can write to Blob storage.
{
"location":"Central US",
"properties":{
"sku":{
"name":"standard"
},
"eventsOutOfOrderPolicy":"drop",
"eventsOutOfOrderMaxDelayInSeconds":10,
"inputs":[
{
"name":"input",
"properties":{
"type":"stream",
"serialization":{
"type":"JSON",
"properties":{
"encoding":"UTF8"
}
},
"datasource":{
"type":"Microsoft.ServiceBus/EventHub",
"properties":{
"eventHubNamespace":"",
"sharedAccessPolicyName":"manage",
"sharedAccessPolicyKey":"",
"serviceBusNamespace":"",
"eventHubName":""
}
}
}
}
],
"transformation":{
"name":"ProcessSampleData",
"properties":{
"streamingUnits":1,
"query":"select * from input"
}
},
"outputs":[
{
"name":"outputblob",
"properties":{
"datasource":{
"type":"Microsoft.Storage/Blob",
"properties":{
"storageAccounts":[{
"accountName":"",
"accountKey":""
}],
"container":"rawoutputcontainer",
"blobPathPrefix":"md"
}
},
"serialization":{
"type":"CSV",
"properties":{
"fieldDelimiter":",",
"encoding":"UTF8"
}
}
}
}
]
}
}
New-AzureStreamAnalyticsJob -ResourceGroupName <Any name> -File <Json file name> -Name <Stream Analytics Job Name>
Here is the Json file that can write to Blob storage.
{
"location":"Central US",
"properties":{
"sku":{
"name":"standard"
},
"eventsOutOfOrderPolicy":"drop",
"eventsOutOfOrderMaxDelayInSeconds":10,
"inputs":[
{
"name":"input",
"properties":{
"type":"stream",
"serialization":{
"type":"JSON",
"properties":{
"encoding":"UTF8"
}
},
"datasource":{
"type":"Microsoft.ServiceBus/EventHub",
"properties":{
"eventHubNamespace":"",
"sharedAccessPolicyName":"manage",
"sharedAccessPolicyKey":"",
"serviceBusNamespace":"",
"eventHubName":""
}
}
}
}
],
"transformation":{
"name":"ProcessSampleData",
"properties":{
"streamingUnits":1,
"query":"select * from input"
}
},
"outputs":[
{
"name":"outputblob",
"properties":{
"datasource":{
"type":"Microsoft.Storage/Blob",
"properties":{
"storageAccounts":[{
"accountName":"",
"accountKey":""
}],
"container":"rawoutputcontainer",
"blobPathPrefix":"md"
}
},
"serialization":{
"type":"CSV",
"properties":{
"fieldDelimiter":",",
"encoding":"UTF8"
}
}
}
}
]
}
}