3

I'm trying to create a Stream Analytics blob storage output using powershell. This is the command I'm using:

New-AzureRMStreamAnalyticsOutput -ResourceGroupName $ResourceGroupName -JobName $JobName –File soutput.json" -Force

and the output.json file looks like this:

{
  "name":  "test",
  "properties":  {
    "datasource":  {
        "type":  "Microsoft.Storage/Blob",
            "properties":  {
                "storageAccounts":  ["testStorage"],
                "container":  "testContainer",
                "pathPattern":  "",
                "accountName":  "testStorage",
                "accountKey":  "storage-key"
            }
        }
    }
}

And I'm getting this error:

New-AzureRMStreamAnalyticsOutput : HTTP Status Code: BadRequest
Error Code: BadRequest
Error Message: The JSON provided in the request body is invalid. 
Error converting value "testStorage" to type 'Microsoft.Streaming.Service.Contracts.CSMResourceProvider.BlobConnectionInfo'. 
Path 'properties.storageAccounts[0]', line 8, position 106.

What should be in the storageAccounts property?

1 Answer 1

3

What should be in the storageAccounts property?

We need to set storageAccounts property:

 "StorageAccounts": [
                     {
                         "AccountKey": "storagekey",
                          "AccountName": "storageaccount"
                     }
                    ]

Property "Serialization" need to be included in the output json file.Please have a try to use output.json file as following. It works correctly for me.

{
   "Name": "S3PSAJobOutPut",
   "Properties": {
                    "DataSource": {
                    "Properties": {
                    "Container": "s3psaoutput",
                    "PathPattern": "",
                    "StorageAccounts": [
                     {
                         "AccountKey": "storagekey",
                          "AccountName": "storageaccount"
                     }
                            ]
                  },
                  "Type": "Microsoft.Storage/Blob"
                  },
                  "Serialization": {
                          "Properties": {
                            "Encoding": "UTF8",
                            "Format": "LineSeparated"
                          },
                          "Type": "Json"
                        }

                  }
}

enter image description here

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.