am trying to auto scale my stream analytics job using C# dotnet SDK, below is the command which am executing to modify the scale of my job.
var streamingJobClient = new StreamAnalyticsManagementClient(new TokenCredentials(token))
{
SubscriptionId = "subscriptionId"
};
await streamingJobClient.Transformations.UpdateAsync(new Transformation() {StreamingUnits = 24},
"GName", "JobName", "Scale");
However when i execute this i am getting the error - "Operation returned an invalid status code 'NotFound'".
Can someone please help me out with this?
CodePudding user response:
I just checked and online scaling is not supported with the .NET API yet. We should be releasing a new version that includes it fairly soon.
In the meantime, you can use the scaling endpoint on the REST API. I don't know why it's not documented, but it's supported:
Method: POST
https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StreamAnalytics/streamingjobs/{jobName}/scale?api-version=2017-04-01-preview
Request Body
{
"streamingUnits” : 6
}
streamingUnits : Integer. Specifies the desired streaming units to scale the streaming job to. Valid values for this property are limited to the set of integers in the “validStreamingUnits” array property that is populated on the first time the streaming job was started.
Response Status Code
- 202 (Accepted) if request was accepted to complete asynchronously.
- 404 (Not Found) if subscription or resource group does not exist.
- 409 (Conflict) if job is in a state where the job can’t be started.