Skip to content
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

Merged
merged 3 commits into from
Aug 3, 2020
Merged

chore: updating pnp samples to normalize dps variables #870

merged 3 commits into from
Aug 3, 2020

Conversation

jebrando
Copy link
Collaborator

Checklist

Reference/Link to the issue solved with this PR (if any)

Description of the problem

Description of the solution

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;
Copy link
Contributor

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;
Copy link
Contributor

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.

Copy link
Collaborator Author

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();
Copy link
Contributor

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;

Copy link
Contributor

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;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comments as above

@jebrando jebrando merged commit 1697838 into Azure:master Aug 3, 2020
@jebrando jebrando deleted the dps_pnp_samples branch August 3, 2020 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants