-
Notifications
You must be signed in to change notification settings - Fork 462
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Access to iothub connection string dynamically from custom iot edge module. #7137
Comments
Just like we can get the deviceId and moduleId dynamically can we get the iot hub connection string? IOTEDGE_DEVICEID |
do you want to get the connection string in the module? |
Hello @ggjjj , I want the IOT hub connection string in custom azure module. Not the module connection string. |
You can build it yourself by quering the values of connection_string = f"HostName={iot_hub_hostname};DeviceId={device_id};SharedAccessKey=" |
Hello @ggjjj , So, what is the best practice of defining the SharedAccessKey in code? And I want iot hub connection string not the device connection string. Format looks like below: |
You can set an env variable by setting the output of Command Link source - https://learn.microsoft.com/en-us/cli/azure/iot/hub/connection-string?view=azure-cli-latest |
Hey @malavvakharia did you try @ggjjj suggestion above? |
Hey @malavvakharia closing this out since no response but feel free to re-open this if you are still experiencing issues. |
Expected Behavior
Tell us what should happen
Current Behavior
Tell us what happens instead of the expected behavior
Steps to Reproduce
Provide a detailed set of steps to reproduce the bug.
1.
2.
3.
4.
Context (Environment)
Output of
iotedge check
Click here
Device Information
Runtime Versions
iotedge version
]:docker version
]:Note: when using Windows containers on Windows, run
docker -H npipe:////./pipe/iotedge_moby_engine version
insteadLogs
aziot-edged logs
edge-agent logs
edge-hub logs
Additional Information
Please provide any additional information that may be helpful in understanding the issue.
The text was updated successfully, but these errors were encountered: