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.
- Select Permissions from the sidebar menu.
- Select Device connection groups.
- Select +New to create a new enrollment group.
- Name your group altair-emulator.
- Select Shared access signature attestation type.
- Select Save
- 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
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}
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.