Hi @Dhanavath Vishnu Apologies for the delayed feedback on this. I have checked with the product team on the possibility this use case. I have been informed that with the current implementation, we do not have a possibility to configure the device offline mode configurations using a Device Twin.
is there anyway the IoTEdge modules/device can read the iothubowner policy primary connection string as environment variable
As far as I can tell, the IoTHub owner policy connection string is not accessible to the IoT Edge module by default. You can use the Azure CLI command az iot hub show-connection-string --policy-name iothubowner --name <hub-name> --output tsv
or access Shared Access policy section of IoT Hub on Azure portal to get the IoT Hub owner connection string. You can then update the module twin with the Environment variable by adding the following in the deployment-manifest.json
file under the module section.
"env": {
"IoTHubConnectionString": {"value": "<ConnectionString>"}
}
Once the twin gets updates, it will store the connection string value in the module's environment variable. Please note that the connection string set using this approach would be displayed in plain text.
Hope this helps. Please let us know if you have any additional questions or need further assistance on this.