Reputation: 186
I would like to create a stream analytics job using only Powershell. I know that the command to do this is: New-AzureRMStreamAnalyticsInput
. However it requires a JSON file with job details. I found a documentation provided by Microsoft where there is a small template of such a JSON file (check Create paragraph). However it's not enough for me.
I want to create an input from blob storage hence my JSON looks like this:
{
"properties":{
"type":"stream",
"datasource":{
"type":"Microsoft.Storage/Blob",
"properties":{
"accountName":"abc",
"accountKey":"###",
"container":"appinsights",
"pathPattern":"test-blob_2324jklj/PageViews/{date}/{time}",
"dateFormat":"YYYY-MM-DD",
"timeFormat":"HH"
}
}
}
}
After saving it and passing as an argument in New-AzureRMStreamAnalyticsInput
I receive following error: New-AzureRMStreamAnalyticsInput : Stream analytics input name cannot be null
. I think that my JSON file is not correct.
Do you have any templates of json files containing stream analytics job details or can you just tell me how to correctly set up a job through powershell?
Upvotes: 2
Views: 823
Reputation: 279
A simple way of getting your template right is to manually create an input from Portal and then run PowerShell command Get-AzureRmStreamAnalyticsInput
to get the JSON payload.
From your example, it seems you missed the input name. Try something like below:
{
"Name": "BlobInput1",
"Properties": {
... ...
}
}
Upvotes: 3