2
我們目前正在通過Azure流分析將數據從Azure事件中心流式傳輸到Cosmos數據庫。我希望能夠以編程方式更改在數據流式傳輸時完成的查詢(/ Transformation)。Azure流分析CreateOrReplace轉換衝突或錯誤請求
var existingQuery = AnalyticsClient.Transformations.Get(handler.ResourceGroup, handler.JobName, handler.JobName);
if (job.JobState == "Started")
{
AnalyticsClient.StreamingJobs.BeginStopAsync(handler.ResourceGroup, handler.JobName).Wait();
}
var transformation = new Transformation()
{
Query = [email protected]"SELECT
[key] as partition_key
INTO[{outputName}]
FROM Input",
StreamingUnits = 1
};
AnalyticsClient.Transformations.CreateOrReplace(transformation, handler.ResourceGroup, handler.JobName, handler.JobName);
Stream Analytics Job Properties - 轉換顯示爲空。
目前尚不清楚改造的默認名稱可能是,但試圖獲得(作爲作業同名)的工作轉換:
{
"code": "NotFound",
"message": "StreamAnalytics_Prototype_2 does not exist in Stream Analytics job 'StreamAnalytics_Prototype_2' in resource group 'removed' in subscription 'removed'.",
"details": {
"code": "404",
"message": "StreamAnalytics_Prototype_2 does not exist in Stream Analytics job 'StreamAnalytics_Prototype_2' in resource group 'removed' in subscription 'removed'.",
"correlationId": "removed",
"requestId": "removed"
}
}
試圖建立一個轉型:
{
"code": "BadRequest",
"message": "The number of transformations defined for this job exceeds the maximum limit of 1 that is supported.",
"details": {
"code": "400",
"message": "The number of transformations defined for this job exceeds the maximum limit of 1 that is supported."
}
}
非常感謝;這也是有用的:var streamingjob = AnalyticsClient.StreamingJobs.Get(ResourceGroup,JobName,「transformation」); – DanAdrenaline
我還有一個Stream,在這個Stream下查詢被命名爲腳本(我假設一個開發者通過.net創建它),我可以通過活動日誌中的上述方法進行檢查。 – DanAdrenaline