Azure / azure-iot-sdk-csharp

A C# SDK for connecting devices to Microsoft Azure IoT services
Other
464 stars 494 forks source link

serviceClient.CreateStreamAsync() returns timeout if device ID contains numbers #2433

Closed eng-khaled1 closed 11 months ago

eng-khaled1 commented 2 years ago

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:

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, Func3 modifyRequestMessageAsync, Func2 isMappedToException, Func3 processResponseMessageAsync, IDictionary2 errorMappingOverrides, CancellationToken cancellationToken) at Microsoft.Azure.Devices.HttpClientHelper.ExecuteWithCustomOperationTimeoutAsync(HttpMethod httpMethod, Uri requestUri, TimeSpan operationTimeout, Func3 modifyRequestMessageAsync, Func2 isMappedToException, Func3 processResponseMessageAsync, IDictionary2 errorMappingOverrides, CancellationToken cancellationToken) at Microsoft.Azure.Devices.HttpClientHelper.PostAsync[T,T2](Uri requestUri, T entity, TimeSpan operationTimeout, IDictionary2 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

timtay-microsoft commented 11 months ago

This feature doesn't seem like it will ever be publicly released, so I'm going to close this thread.