Azure Connector configuration

Customize the remote connectivity.

Properties

To control all aspects of the azure connector behavior.

PropertyTypeDefaultDescription
tenantIdstringdefaultTenantTenant unique identifier that the device belongs to
connectionStringstring ​The connection string for connectivity to Azure IoT Hub, the format is: "HostName=newHostName.azure-devices.net;DeviceId=deviceId;SharedAccessKey=accessKey"
sasTokenValiditystring1hThe validity period for the generated SAS token for device authentication. Positive integer number followed by a unit suffix, such as ‘300m’, ‘1h’, etc., time units are: m, h, d
idScopestringID scope for Azure Device Provisioning service
Remote connectivity - TLS
alpnstring[]TLS application layer protocol negotiation options space separated for cloud access
caCertstringiothub.crtPEM encoded CA certificates file
certstringPEM encoded certificate file to authenticate to the MQTT endpoint
keystringPEM encoded unencrypted private key file to authenticate to the MQTT endpoint
Remote connectivity - TLS over TPM
tpmDevicestringPath to the device file or the unix socket to access the TPM 2.0
tpmHandleintTPM 2.0 storage root key handle, the type is unsigned 64-bit integer
tpmKeyPubstringFile path to the public part of the TPM 2.0 key
tpmKeystringFile path to the private part of the TPM 2.0 key
Local connectivity
localAddressstringtcp://localhost:1883Address of the MQTT server/broker that the azure connector will connect for the local communication, the format is: scheme://host:port
localUsernamestringUsername that is a part of the credentials
localPasswordstringPassword that is a part of the credentials
Local connectivity - TLS
localCACertstringPEM encoded CA certificates file
localCertstringPEM encoded certificate file to authenticate to the MQTT server/broker
localKeystringPEM encoded unencrypted private key file to authenticate to the MQTT server/broker
Logging
logFilestringlogs/azure-connector.logPath to the file where log messages are written
logLevelstringINFOAll log messages at this or a higher level will be logged, the log levels in descending order are: ERROR, WARN, INFO, DEBUG and TRACE
logFileCountint5Log file maximum rotations count
logFileMaxAgeint28Log file rotations maximum age in days, use 0 to not remove old log files
logFileSizeint2Log file size in MB before it gets rotated

Example

The minimal required configuration to connect.

{
    "connectionString": "HostName=hostName.azure-devices.net;DeviceId=deviceId;SharedAccessKey=cGFzc3AvcKQ=",
    "caCert": "/etc/azure-connector/iothub.crt",
    "logFile": "/var/log/azure-connector/azure-connector.log"
}

Template

The configuration can be further adjusted according to the use case. The following template illustrates all possible properties with their default values.

{
    "tenantId": "defaultTenant",
    "connectionString": "",
    "sasTokenValidity": "1h",
    "idScope": "",
    "alpn" : [],
    "caCert": "iothub.crt",
    "cert": "",
    "key": "",
    "tpmDevice": "",
    "tpmHandle": 0,
    "tpmKeyPub": "",
    "tpmKey": "",
    "localAddress": "tcp://localhost:1883",
    "localUsername": "",
    "localPassword": "",
    "localCACert": "",
    "localCert": "",
    "localKey": "",
    "logFile": "logs/azure-connector.log",
    "logLevel": "INFO",
    "logFileCount": 5,
    "logFileMaxAge": 28,
    "logFileSize": 2
}
Last modified June 17, 2024