-
Notifications
You must be signed in to change notification settings - Fork 226
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
chore: updating pnp samples to normalize dps variables #870
Conversation
var symmetricKey = process.env.PROVISIONING_SYMMETRIC_KEY; | ||
var provisioningHost = process.env.IOTHUB_DEVICE_DPS_ENDPOINT; | ||
var idScope = process.env.IOTHUB_DEVICE_DPS_ID_SCOPE; | ||
var registrationId = process.env.IOTHUB_DEVICE_DPS_DEVICE_ID; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems unfortunate that we have a DPS_DEVICE_ID environment variable being assigned to a registrationId variable.
var provisioningHost = process.env.PROVISIONING_HOST; | ||
var idScope = process.env.PROVISIONING_IDSCOPE; | ||
var registrationId = process.env.PROVISIONING_REGISTRATION_ID; | ||
var symmetricKey = process.env.PROVISIONING_SYMMETRIC_KEY; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're not using the same environment variables as the simple_thermostat.js file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, that's a missed copy paste.
} | ||
|
||
try { | ||
let result = await provisioningClient.register(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you need a switch here which if dps u do this otherwise we go normally to connect to hub with connection string..
var idScope = process.env.PROVISIONING_IDSCOPE; | ||
var registrationId = process.env.PROVISIONING_REGISTRATION_ID; | ||
var symmetricKey = process.env.PROVISIONING_SYMMETRIC_KEY; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you also need the environmental variable for device connection string that is gonna be used when dps not available
var idScope = process.env.PROVISIONING_IDSCOPE; | ||
var registrationId = process.env.PROVISIONING_REGISTRATION_ID; | ||
var symmetricKey = process.env.PROVISIONING_SYMMETRIC_KEY; | ||
var provisioningHost = process.env.IOTHUB_DEVICE_DPS_ENDPOINT; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same comments as above
Checklist
devdoc
folder and added or modified requirements.Reference/Link to the issue solved with this PR (if any)
Description of the problem
Description of the solution