# Connect to azure by MQTTT ( not azure iot node )?

**URL:** https://discourse.nodered.org/t/connect-to-azure-by-mqttt-not-azure-iot-node/34666
**Category:** General
**Created:** [22 October 2020 09:07 UTC](https://discourse.nodered.org/t/connect-to-azure-by-mqttt-not-azure-iot-node/34666 "2020-10-22T09:07:24Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![vtgav](https://avatars.discourse-cdn.com/v4/letter/v/f0a364/32.png) [@vtgav](https://discourse.nodered.org/u/vtgav)
#### Post date: [22 October 2020 09:07 UTC](https://discourse.nodered.org/t/connect-to-azure-by-mqttt-not-azure-iot-node/34666/1 "2020-10-22T09:07:24Z")

</div>

Greetings,

I’ve been trying to connect to an azure iot hub using the Mqtt node and always get ‘not authorised’.

I can successfully connect and send messages using the azure iot node but I’m trying to simulate a device which cannot use the sdk and can only use ‘native’ mqtt, hence my focus is on the mqtt node.

I configure the mqtt node with a username and sas password, and have uploaded the azure ca certificate and set the node as ssl, but as I mentioned I always get ‘not authorised’.

Any ideas appreciated,  
Thx, Gav

---

<div class="post-metadata">

### Author: ![janvda](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/janvda/32/234_2.png) [@janvda](https://discourse.nodered.org/u/janvda)
#### Post date: [22 October 2020 09:21 UTC](https://discourse.nodered.org/t/connect-to-azure-by-mqttt-not-azure-iot-node/34666/2 "2020-10-22T09:21:59Z")

</div>

Have you checked following links:

- [https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-mqtt-support#using-the-mqtt-protocol-directly-as-a-device](https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-mqtt-support#using-the-mqtt-protocol-directly-as-a-device)
- [https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-mqtt-support#tlsssl-configuration](https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-mqtt-support#tlsssl-configuration)

---

<div class="post-metadata">

### Author: ![vtgav](https://avatars.discourse-cdn.com/v4/letter/v/f0a364/32.png) [@vtgav](https://discourse.nodered.org/u/vtgav)
#### Post date: [22 October 2020 09:34 UTC](https://discourse.nodered.org/t/connect-to-azure-by-mqttt-not-azure-iot-node/34666/3 "2020-10-22T09:34:38Z")

</div>

Thank you yes I have, I used them as references for example to figure how to create the sas token.

I guess for most people they’d just use the azure nodes, and I know they work, nice and simple. It’s only because I wanted to simulate the actual device that I went native mqtt node. I’ve also written some test c code which also works, and this used the config I use on the mqtt node, sas token etc. So I’m a bit baffled really.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [21 December 2020 09:34 UTC](https://discourse.nodered.org/t/connect-to-azure-by-mqttt-not-azure-iot-node/34666/4 "2020-12-21T09:34:39Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
