What is a Component ID?
Every Azure Sphere application must have a unique component ID so it can be easily identified. The component ID is a universally unique identifier (UUID) also known as globally unique identifier (GUID) which is a string that contains a set of hexadecimal digits. For example, 02ce3860-3126-42af-8ac7-c2a661134129. Each application has a different component ID to avoid possible conflicts.
Generate a component ID
The first time you open a CMake project in Visual Studio or Visual Studio Code, CMakeLists generation automatically runs and sets the component ID for the application in the app_manifest.json file. If you run the application without a component ID, the build fails. If required, you can manually generate a GUID/UUID and update the application manifest setting.
To generate a GUID or UUID:
- On the Tools menu, choose Create GUID.
- In the GUID generator program, choose the Registry Format option button, choose the Copy button, and then choose the Exit button.
Paste the generated GUID/UUID in the
ComponentId field of the application's app_manifest.json file. For example:
Find the component ID
The component ID of an application is required for identifying an application. You can find the component ID for an application in any the following ways:
- Check the component ID in the
ComponentIdfield of the application's app_manifest.json file.
- Use the command azsphere device app show-status to list the status and component ID of the application on the attached device.
- Use the command azsphere device image list-installed to list the images currently on the attached device. Note the component ID of the required application.