0

I have azure Iot hub with connection details like address, remote_username, remote_password which my device uses to connect to the IoT hub. I am running mosquitto which uses below configuration settings in order to connect to azure Iot hub:

connection iot-bridge
log_type all
address apsdc.azure-devices.net:8883
remote_username apsdc.azure-devices.net/Device1
remote_password SharedAccessSignature sr=apsdc.azure-devices.net&sig=ofIUhB3Tx6r3lGruCveI166ua655y8wA7U5dffqxBqY%3D&se=1534941834&skn=iothubowner
remote_clientid Device1

....
other settings...
....

Mosquitto on device connects to the iot-bridge which is apsdc.azure-devices.net using the provided username and sas password. I was wondering if its possible to use any public IP address instead of apsdc.azure-devices.net. Is there any settings on azure to get the IP address. Thanks

S Andrew
  • 5,592
  • 27
  • 115
  • 237
  • You might want to add your comments to this user voice request: https://feedback.azure.com/forums/321918-azure-iot/suggestions/15714243-iot-hub-network-address – Dominic Betts Feb 01 '19 at 06:47
  • @DominicBetts From the link you mentioned, it looks like using IP address is not a good idea.? – S Andrew Feb 01 '19 at 06:50
  • The problem seems to be that the IP address of a hub can change without notice - from the link, I'm not sure exactly what circumstances might trigger a change. – Dominic Betts Feb 01 '19 at 06:59

1 Answers1

0

According to this page, you can recompile Mosquitto to support DNS so that you no longer have to connect to an IP address.

Alex Marshall
  • 10,162
  • 15
  • 72
  • 117
  • I am using kuberneter v1.13 and its coredns always remains in `CrashLoopBackOff` due to which DNS is not working and thus mosquitto is also not able to connect to IoT hub and this is why I wanted to get the IP address. https://stackoverflow.com/questions/54466359/coredns-crashloopbackoff-in-kubernetes – S Andrew Feb 01 '19 at 04:46