microsoft / vscode-azure-iot-toolkit

Azure IoT Hub extension for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=vsciot-vscode.azure-iot-toolkit
Other
73 stars 58 forks source link

ERROR: 'Error parsing connection string. Please make sure you wrap the connection string with double quotes when supplying it via CLI' #536

Open RonMatsu opened 2 years ago

RonMatsu commented 2 years ago

I'm getting this error no matter what I try with the command 'iotedgehubdev setup -c ""'.

I'm using double quotes. Even the auto generated command issued by clicking "Setup IoT Edge Simulator" in VS code still generates the error.

command as below but I changed access keys and device names to 'X' chars for privacy: $ sudo iotedgehubdev setup -c "HostName=XXXXXXX.azure-devices.net;DeviceId=XXXXXXX;x509=true"

auto generated: $ sudo "iotedgehubdev" setup -c "HostName=XXXXXXX.azure-devices.net;DeviceId=XXXXXXX;x509=true" -i "HostName=XXXXXXX.azure-devices.net;SharedAccessKeyName=iothubowner;SharedAccessKey=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX="

Thanks.

marianan commented 1 year ago

Hi @RonMatsu,

The iotedgehubdev tool only supports shared access key authentication to the device in IoT Hub.

Looks like you have created a Edge device entity with X.509 cert. Can you try to create Edge device with Shared Access Key and see if it works?

Your device connection string is - HostName=XXXXXXX.azure-devices.net;DeviceId=XXXXXXX;x509=true