Azure-Samples/iotedge_config_cli

iothub_hostname in iotedge_config.yaml not used

Closed this issue · 2 comments

I was wondering why the iotedge_config tool would require iothub_hostname and iothub_name, since the latter is a component of the first. I'm new to Rust, but upon looking at the Rust source, it appears iothub_hostname is not used.

The iothub_hostname is used to create the device's configs and is what devices will use to connect to hub. https://github.com/Azure-Samples/iotedge_config_cli/blob/main/src/main.rs#L998

The iothub_name is used to create the devices on a specific hub using the az cli. The hubname is usually part of the hostname, but not always. For example, using a direct IP address for the iothub_hostname is perfectly valid.

jlian commented

Another reason is that, in Azure US Gov for example, the IoT Hub hostname is different (*.azure-devices.us), so it's best to ask the user.

EDIT: though in that case the tool could just use az iot hub show and find the hostname returned. Hmm