Azure-docs: CONNECT failed: RefusedNotAuthorized

Created on 8 May 2020  Â·  4Comments  Â·  Source: MicrosoftDocs/azure-docs

Followed step by step and at the end got CONNECT failed: RefusedNotAuthorized

The DPS assigns my device to IoTHub

Registration Assigned
ProvisioningClient AssignedHub: my-iot-hub.azure-devices.net; DeviceID: elevator

and I can see this device in IotHub Devices. But at the line

await iotClient.OpenAsync().ConfigureAwait(false);

got

System.AggregateException: One or more errors occurred. (CONNECT failed: RefusedNotAuthorized)
---> Microsoft.Azure.Devices.Client.Exceptions.UnauthorizedException: CONNECT failed: RefusedNotAuthorized
at Microsoft.Azure.Devices.Client.Transport.Mqtt.MqttTransportHandler.OpenAsyncInternal(CancellationToken cancellationToken)
at Microsoft.Azure.Devices.Client.Transport.Mqtt.MqttTransportHandler.OpenAsync(CancellationToken cancellationToken)
at Microsoft.Azure.Devices.Client.Transport.ProtocolRoutingDelegatingHandler.OpenAsync(TimeoutHelper timeoutHelper)
at Microsoft.Azure.Devices.Client.Transport.ErrorDelegatingHandler.<>c__DisplayClass23_0.<<ExecuteWithErrorHandlingAsync>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.Azure.Devices.Client.Transport.ErrorDelegatingHandler.ExecuteWithErrorHandlingAsyncT
at Microsoft.Azure.Devices.Client.Transport.RetryDelegatingHandler.<>c__DisplayClass34_0.<<OpenInternalAsync>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.Azure.Devices.Client.Transport.RetryDelegatingHandler.EnsureOpenedAsync(TimeoutHelper timeoutHelper)
at Microsoft.Azure.Devices.Client.Transport.RetryDelegatingHandler.<>c__DisplayClass18_0.<<ReceiveAsync>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.Azure.Devices.Client.Transport.RetryDelegatingHandler.ReceiveAsync(TimeoutHelper timeoutHelper)
at Microsoft.Azure.Devices.Client.InternalClient.ReceiveAsync(TimeSpan timeout)
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at System.Threading.Tasks.Task.Wait()


Should I add the root certificate to IoT Hub -> Certificates?
Could anyone please help?

Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Pri2 cxp iot-dpsvc product-issue triaged

All 4 comments

@Marusyk Thanks for the feedback! We are currently investigating and will update you shortly.

@Marusyk We have reviewed the document and unable to repro the issue (for C#-Individual Enrollment-self-signed scenario). Could you please let us know which Enrollment type you have used? Please let us know if you have used self-signed or CA X.509 certificates?

Hello, I've used Group Enrollment with self-signed certificate. But I can't reproduce it again for now. So, I think you can close this issue. I will let you know if I get this error again. Thanks

@Marusyk We will now proceed to close this thread. If there are further questions regarding this matter, please tag me in your reply. We will gladly continue the discussion and we will reopen the issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

DeepPuddles picture DeepPuddles  Â·  3Comments

ianpowell2017 picture ianpowell2017  Â·  3Comments

JamesDLD picture JamesDLD  Â·  3Comments

varma31 picture varma31  Â·  3Comments

mrdfuse picture mrdfuse  Â·  3Comments