The config.yaml on the device is specifies:
Note:
The values of all of these fields can be specified either as a
"file" scheme URI such as "file:///C:/cert_key.pem" or a
file path such as "C:\\cert_key.pem"
so I would expect this powershell command
. {Invoke-WebRequest -useb https://aka.ms/iotedge-win} | Invoke-Expression; ` Initialize-IoTEdge -Dps -ScopeId XXXXXX -X509IdentityCertificate C:/Data/Users/DefaultAccount/Documents/cert.pem -X509IdentityPrivateKey C:/Data/Users/DefaultAccount/Documents/key.pem
to create a config file like
provisioning:
source: 'dps'
global_endpoint: 'https://global.azure-devices-provisioning.net'
scope_id: 'XXXXXXX'
attestation:
method: 'x509'
identity_cert: 'file:///C:/Data/Users/DefaultAccount/Documents/cert.pem'
identity_pk: 'file:///C:/Data/Users/DefaultAccount/Documents/key.pem'
OR
provisioning:
source: 'dps'
global_endpoint: 'https://global.azure-devices-provisioning.net'
scope_id: 'XXXXXXX'
attestation:
method: 'x509'
identity_cert: 'C:\\Data\\Users\\DefaultAccount\\Documents\\cert.pem'
identity_pk: 'C:\\Data\\Users\\DefaultAccount\\Documents\\key.pem'
provisioning:
source: 'dps'
global_endpoint: 'https://global.azure-devices-provisioning.net'
scope_id: 'XXXXXXX'
attestation:
method: 'x509'
identity_cert: 'C:/Data/Users/DefaultAccount/Documents/cert.pem'
identity_pk: 'C:/Data/Users/DefaultAccount/Documents/key.pem'
Creates issue
12/17/2019 11:49:13 AM info: iotedged::app -- Starting Azure IoT Edge Security Daemon
12/17/2019 11:49:13 AM info: iotedged::app -- Version - 1.0.9~rc3 (9f6b4967bc7148512a7f6c50f93aaa86c0a16da4)
12/17/2019 11:49:13 AM info: iotedged::app -- Using config file: C:\Data\ProgramData\iotedge\config.yaml
12/17/2019 11:49:13 AM error: edgelet_utils::logging -- caused by: File URI c:/Data/Users/DefaultAccount/Documents/cert.pem is unsupported
for 'provisioning.attestation.identity_cert'. Please check the config.yaml file.
12/17/2019 11:49:13 AM error: edgelet_utils::logging -- caused by: The daemon could not start up successfully: Could not configure Edge X.509
identity certificate
12/17/2019 11:49:13 AM error: iotedged::windows -- Error while running service. Quitting.
Provide a detailed set of steps to reproduce the bug.
Able to fix by manually appending "file:///" to beginning of path, but this is not possible in the production environment.
1.0.9 rc3
iotedge checkThe term 'iotedge' is not recognized as the name of a cmdlet ...
Click here
<Paste here between the triple backticks>
iotedge version]: docker version]: Note: when using Windows containers on Windows, run docker -H npipe:////./pipe/iotedge_moby_engine version instead
iotedged logs
<Paste here between the triple backticks>
edge-agent logs
<Paste here between the triple backticks>
edge-hub logs
<Paste here between the triple backticks>
Please provide any additional information that may be helpful in understanding the issue.
Hi!
Since you are using the 1.0.9-rc, please be sure to use the installer script from 1.0.9 (rather than the version found at https://aka.ms/iotedge-win which points to our current stable 1.0.8.x). You can find it here:
https://github.com/Azure/iotedge/blob/1.0.9-rc3/scripts/windows/setup/IotEdgeSecurityDaemon.ps1
This contains updated versions of functions like Initialize-IoTEdge
Hi,
Thanks for the quick response. unfortunately when I don't reference https://aka.ms/iotedge-win, using just:
Initialize-IoTEdge -Dps -ScopeId $scopeId -ContainerOs Windows -X509IdentityCertificate $x509IdentityCertificate -X509IdentityPrivateKey $x509IdentityPrivateKey
It throws error: The term 'Initialize-IoTEdge' is not recognized as the name of a cmdlet.
Is it an issue with my Deploy-IotEdge command?
. {Invoke-WebRequest -useb https://aka.ms/iotedge-win} | Invoke-Expression; `
Deploy-IoTEdge -OfflineInstallationPath C:/Data/Users/DefaultAccount/Documents
Confirmed that it is actually using the .cab file from the repo to Deploy.
You need to replace the aka.ms url with the one that I provided.
Also, please don't use the aka.ms url for Deploy-IoTEdge - you need to use the URL that I provided which points to the 1.0.9-rc script.
For example,
". {Invoke-WebRequest -useb https://github.com/Azure/iotedge/blob/1.0.9-rc3/scripts/windows/setup/IotEdgeSecurityDaemon.ps1} | Invoke-Expression; ` Initialize-IoTEdge -Dps -ScopeId XXXXXX -X509IdentityCertificate C:/Data/Users/DefaultAccount/Documents/cert.pem -X509IdentityPrivateKey C:/Data/Users/DefaultAccount/Documents/key.pem"
@AaronEdelman Did that resolve your issue?
@kkdawkins Not yet. When running the Deploy or Initialize with that url it throws error
Invoke-Expression : At line:149 char:19
Sorry, I meant to give you GitHub's raw version. Please use this:
https://raw.githubusercontent.com/Azure/iotedge/1.0.9-rc3/scripts/windows/setup/IotEdgeSecurityDaemon.ps1
@kkdawkins All good now. Thanks a lot!