3

powershell을 사용하여 스트림 분석 BLOB 저장소 출력을 만들려고합니다. 이것은 내가 사용하고 명령입니다 :Powershell을 사용하여 스트림 분석 용 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 속성에 있어야합니까?

답변

2

What should be in the storageAccounts property?

우리는 storageAccounts 속성을 설정해야합니다

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

속성 "Serialization"을 다음과 같은 파일을 output.json 사용하는 시도를 출력 JSON file.Please에 포함 할 필요가있다. 그것은 나를 위해 올바르게 작동합니다.

{ 
    "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