Azure-docs: Problems to run the back-end application

Created on 28 Jan 2019  Â·  4Comments  Â·  Source: MicrosoftDocs/azure-docs

At the Step 3 of the 'Read the telemetry from your Hub' topic, i tried to do the instruction quoted, but the following error appeared:

PS C:UsersSTD> cd C:UsersSTDazure-iot-samples-node-masteriot-hubQuickstartsread-d2c-messages
PS C:UsersSTDazure-iot-samples-node-masteriot-hubQuickstartsread-d2c-messages> npm install
audited 458 packages in 1.981s
found 0 vulnerabilities

PS C:UsersSTDazure-iot-samples-node-masteriot-hubQuickstartsread-d2c-messages> node ReadDeviceToCloudMessages.js
'sharedAccessKeyName' is a required property of the ConnectionConfig.

How can i fix it?
I tried do found that parameter in the .js file but it doesn't exist, i think.

Thanks.


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Pri2 cxp doc-bug in-progress iot-husvc triaged

Most helpful comment

Hi @Alberto-Vega-MSFT !!

I found the problem with the connectionString.
I was using the IoT device's connectionString, and i should have used the connectionString of the Shared access policies in my IoT Hub.

Thank you for your time and support!!

All 4 comments

Hi @CaioCPSilva On step 2. Open the ReadDeviceToCloudMessages.js have you replaced the connectionString variable with a connection string that looks like this?

HostName={YourIoTHubName}.azure-devices.net;SharedAccessKeyName=iothubowner;SharedAccessKey={YourSharedAccessKey}

I'm trying to make sure the connection string has the ShareAccessKeyName

Hi @Alberto-Vega-MSFT!

Based on your answer, my connectionString doesn't have the "SharedAccessKeyName" as a parameter.
Can i insert this manually in the ReadDeviceToCloudMessages.js archive?

Thanks for your help!!

Hi @Alberto-Vega-MSFT !!

I found the problem with the connectionString.
I was using the IoT device's connectionString, and i should have used the connectionString of the Shared access policies in my IoT Hub.

Thank you for your time and support!!

gracias , me arreglaron el dia :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

JeffLoo-ong picture JeffLoo-ong  Â·  3Comments

varma31 picture varma31  Â·  3Comments

DeepPuddles picture DeepPuddles  Â·  3Comments

jharbieh picture jharbieh  Â·  3Comments

bdcoder2 picture bdcoder2  Â·  3Comments