Skip to main content

Create a device key

To securely connect the Altair emulator to Azure IoT Central you need to create a device ID and a derived device key.

Install the Azure CLI tools

Follow the How to install the Azure CLI guide to install the Azure CLI on your computer.

Create an IoT Central enrollment group

From the Azure IoT Central web portal, follow these steps.

  1. Select Permissions from the sidebar menu.
  2. Select Device connection groups.
  3. Select +New to create a new enrollment group.
  4. Name your group altair-emulator.
  5. Select Shared access signature attestation type.
  6. Select Save
  7. While on this page, copy the ID scope of your Azure IoT Central application somewhere safe. You will need the *ID scope** when you start the Altair emulator.

Create the device key

  1. Open a Terminal window on your computer and run the compute-device-key command to generate a device-derived key. Notes.

    • You will likely be prompted to install the azure-iot extension. Select Y, and press Enter.
    • The primary key is the primary key generated by your newly created IoT Central enrollment group.
    • The device id is any arbitrary/sensible name, for example, myAltair.
    az iot central device compute-device-key --pk {primaryKey} --device-id {deviceid}
  2. Copy the Device ID, and the Derived key somewhere safe as you will need these values when you start the Altair emulator in cloud-connected mode.