I am trying to set up an SSH channel through a streaming service. For this purpose, I am using Azure C# SDK.
This is done via two APIs:
Service Menager on the user side, which initiates the connection to the streaming service on the hub and addresses it with the device ID.(where I suppose the error lies).
Lisiting and handling API on the device side
it turned out that the streaming request does not reach devices with IDs containing numbers, which causes the connection to Rest Deu to Time Out Error .
Context
Description of the issue
I am trying to set up an SSH channel through a streaming service. For this purpose, I am using Azure C# SDK. This is done via two APIs:
Service Menager on the user side, which initiates the connection to the streaming service on the hub and addresses it with the device ID.(where I suppose the error lies).
Lisiting and handling API on the device side
it turned out that the streaming request does not reach devices with IDs containing numbers, which causes the connection to Rest Deu to Time Out Error .
Code sample exhibiting the issue
DeviceStreams Sample
Console log of the issue:
fail: ServiceProxy[0] An error occured during streaming session. Microsoft.Azure.Devices.Common.Exceptions.UnauthorizedException: {"Message":"{\"errorCode\":401002,\"trackingId\":\"33c7b424b11d46a0beed00726c8da89e-G:0-TimeStamp:06/14/2022 08:24:33\",\"message\":\"Unauthorized\",\"timestampUtc\":\"2022-06-14T08:24:33.8005084Z\"}","ExceptionMessage":""} at Microsoft.Azure.Devices.HttpClientHelper.ExecuteAsync(HttpClient httpClient, HttpMethod httpMethod, Uri requestUri, Func
3 modifyRequestMessageAsync, Func2 isMappedToException, Func
3 processResponseMessageAsync, IDictionary2 errorMappingOverrides, CancellationToken cancellationToken) at Microsoft.Azure.Devices.HttpClientHelper.ExecuteWithCustomOperationTimeoutAsync(HttpMethod httpMethod, Uri requestUri, TimeSpan operationTimeout, Func
3 modifyRequestMessageAsync, Func2 isMappedToException, Func
3 processResponseMessageAsync, IDictionary2 errorMappingOverrides, CancellationToken cancellationToken) at Microsoft.Azure.Devices.HttpClientHelper.PostAsync[T,T2](Uri requestUri, T entity, TimeSpan operationTimeout, IDictionary
2 errorMappingOverrides, IDictionary2 customHeaders, CancellationToken cancellationToken) at Microsoft.Azure.Devices.AmqpServiceClient.CreateStreamAsync(Uri uri, DeviceStreamRequest deviceStreamRequest, CancellationToken cancellationToken) at IoTHubDeviceStreamSample.ServiceProxy.DeviceStream.HandleIncomingConnectionsAndCreateStreams(String deviceId, ServiceClient serviceClient, TcpClient tcpClient, CancellationTokenSource cancellationTokenSource) in C:\Users\khaled.aldayeh\OneDrive - OMS Prüfservice GmbH\Desktop\munit-solutions-serviceproxyssh-52bd4c024d5d\ServiceProxy\DeviceStream.cs:line 57