0
votes

I use Azure IoT HUB and I want connect to device and send/receive messages.

First of all I generate SaS token and connect to IoT HUB.

After this I create new device: create new certificate get thumbprint and set this thumbprint to new device.

At last I use certificate and connect to device via AMQP. But get error after attaching:

amqp:unauthorized-access

In attach packet target address is "devices/{device-id}/messages/events"

What's wrong? Why I get this error?

1
Can you show the code sample?Rita Han
@RitaHan-MSFT code sample of what part?Anthony
A code sample is able to reproduce your issue. Have you generated, signed the X.509 certs?Rita Han
@RitaHan-MSFT here my sample: github.com/bananaRanger/CertificateGeneratorAnthony
@Anthony have you connect your device with AMQP if yes then please share a code of sampleVishal Solanki

1 Answers

0
votes

Most likely your passing the SaS token incorrectl. What language are you using? Are you using preexisting library or are you trying to implement AMQP by hand?

Have a look at this post for pretty good documentation, library sources can be found here.