The following API calls are available for the Azure Injector Module and can be executed within the Ignition Designer Script Console.

APIs

Sample Script


Cirrus Link provides these scripts as examples only, they are not supported or guaranteed to meet any particular functionality. Cirrus Link cannot provide any assistance to modify these scripts to meet a particular need.


# Cirrus Link provides these scripts as examples only, they are not supported or guaranteed to meet any particular functionality. Cirrus Link cannot provide any assistance to modify these scripts to meet a particular need
# Update Certificates
# Get Id for current certificate
savedCerts = system.cirruslink.azure.readConfig("Cert Files")
for config in savedCerts:
  if config["Name"] == "My current cert name":
    certId = config["Id"]

# Read New Cert File
deviceCaCertFilePath = "/path/to/your/certs/iot-edge-device-ca-CA.cert.pem"
deviceCaCert = open(deviceCaCertFilePath, 'r').read()

# Update existing cert config using MergeOverwrite
certProps = {}
certProps["FileContents"] = deviceCaCert
system.cirruslink.azure.updateConfig(“Cert Files”, certId, “MergeOverwrite”, certProps)