diff --git a/samples/net/azure_iot_hub/src/main.c b/samples/net/azure_iot_hub/src/main.c index af6c0dd569cc..e7722d355f89 100644 --- a/samples/net/azure_iot_hub/src/main.c +++ b/samples/net/azure_iot_hub/src/main.c @@ -507,20 +507,22 @@ static int dps_run(struct azure_iot_hub_buf *hostname, struct azure_iot_hub_buf int main(void) { int err; - char hostname[128] = CONFIG_AZURE_IOT_HUB_HOSTNAME; - char device_id[128] = CONFIG_AZURE_IOT_HUB_DEVICE_ID; - struct azure_iot_hub_config cfg = { + static char hostname[128] = CONFIG_AZURE_IOT_HUB_HOSTNAME; + static char device_id[128] = CONFIG_AZURE_IOT_HUB_DEVICE_ID; + static struct azure_iot_hub_config cfg = { .device_id = { .ptr = device_id, - .size = strlen(device_id), }, .hostname = { .ptr = hostname, - .size = strlen(hostname), }, .use_dps = true, }; + cfg.device_id.size = strlen(device_id); + cfg.hostname.size = strlen(hostname); + + LOG_INF("Azure IoT Hub sample started"); /* Setup handler for Zephyr NET Connection Manager events. */