local.json5
Sometimes during development, it is useful to be able to override settings in the ioto.json5 configuration file for testing purposes.
The local.json5 configuration file serves this purpose and is blended with and overrides the ioto.json5 configuration file.
The local.json5 configuration file has the same properties as the ioto.json5 configuration file.
Profiles
The local.json5 configuration can use multiple property profiles that are selected at runtime.
When Ioto is run, it executes with selected profile. This is typically prod
for production and dev
for development. However, you can create your own profiles for any desired execution configuration such as qa
or test
.
The Ioto profile is defined via the PROFILE environment variable or via the --profile
command line option.
Configuration profiles are defined under the conditional.profile property in any configuration file. The relevant configuration properties are selected by the current Ioto profile.
For example:
Overriding the device.json5
A typical use-case for the local.json5 is to override the device.json5 and specify a test device ID and product. You can also specify a manager account and cloud ID to auto-claim the device.