我正在尝试使用PowerShell创建Stream Analytics blob存储输出。 这是我正在使用的命令:
New-AzureRMStreamAnalyticsOutput -ResourceGroupName $ResourceGroupName -JobName $JobName –File soutput.json" -Force
并且output.json文件如下所示:
{
"name": "test",
"properties": {
"datasource": {
"type": "Microsoft.Storage/Blob",
"properties": {
"storageAccounts": ["testStorage"],
"container": "testContainer",
"pathPattern": "",
"accountName": "testStorage",
"accountKey": "storage-key"
}
}
}
}
我收到了这个错误:
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.
storageAccounts属性应该包含哪些内容?
答案 0 :(得分:3)
storageAccounts属性应该包含哪些内容?
我们需要设置storageAccounts属性:
"StorageAccounts": [
{
"AccountKey": "storagekey",
"AccountName": "storageaccount"
}
]
属性“Serialization
”需要包含在输出json文件中。请尝试使用output.json文件,如下所示。它适用于我。
{
"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"
}
}
}