Azure IoT Hub HTTP Node 401 Error

Hi,

I am trying to connect to Azure IoT Hub using HTTP POST and I am getting 401 error. even with api-version=2018-06-30,2016-11-14

image

Authorization : Basic
Username : {IoT-Hub-name}}/{deivce-Name}}/api-version=2021-04-12
Password = generated using az iot hub generate-sas-token -n {IoT-Hub-Name}
URL Template = https://{IoT-Hub-Name}/devices/{device-name}/messages/events?api-version=2021-04-12

Please let me know
Subrahmanyam

It looks like you’re trying to interact with this API:

There’s not much help I can offer you here other than to point you to this authentication guide I found in Azure’s documentation …