Supported output formats for Azure Sphere CLI
Important
This is the Azure Sphere (Legacy) documentation. Azure Sphere (Legacy) is retiring on 27 September 2027, and users must migrate to Azure Sphere (Integrated) by this time. Use the Version selector located above the TOC to view the Azure Sphere (Integrated) documentation.
Azure Sphere CLI supports several formats in which the data can be viewed. By default, it uses table
as the default format for displaying the CLI output, but also supports other formats.
Note
- The output displayed for a command may vary for different output type.
The argument values and the output types are:
Output format | Description |
---|---|
table |
ASCII table with keys as column headings. This is the default format. |
json |
JSON string. |
jsonc |
Colorized JSON. |
yaml |
YAML, a machine-readable alternative to JSON. |
yamlc |
Colorized YAML. |
tsv |
Tab-separated values, with no keys. |
none |
No output other than errors and warnings. |
Supported commands
You can specify the required output format for the command using --output
, --out
, or -o
. If we’re missing a command that you need to script, let us know with azsphere feedback.
It is supported for the following commands:
- azsphere ca-certificate list
- azsphere ca-certificate download
- azsphere ca-certificate download-chain
- azsphere ca-certificate download-proof
- azsphere device app show-status
- azsphere device app show-memory-stats
- azsphere device app show-quota
- azsphere device app start
- azsphere device app stop
- azsphere device list
- azsphere device list-attached
- azsphere device certificate add
- azsphere device certificate delete
- azsphere device certificate list
- azsphere device certificate show
- azsphere device certificate show-quota
- azsphere device image list-installed
- azsphere device image list-targeted
- azsphere device network enable
- azsphere device network disable
- azsphere device network list-firewall-rules
- azsphere device network list-interfaces
- azsphere device network proxy apply
- azsphere device network proxy show
- azsphere device network proxy delete
- azsphere device network show-diagnostics
- azsphere device network show-status
- azsphere device network update-interface
- azsphere device rescan-attached
- azsphere device restart
- azsphere device show
- azsphere device show-attached
- azsphere device show-os-version
- azsphere device sideload delete
- azsphere device sideload deploy
- azsphere device sideload set-deployment-timeout
- azsphere device sideload show-deployment-timeout
- azsphere device wifi add
- azsphere device wifi disable
- azsphere device wifi enable
- azsphere device wifi forget
- azsphere device wifi list
- azsphere device wifi reload-config
- azsphere device wifi scan
- azsphere device wifi show
- azsphere device wifi show-status
- azsphere device-group create
- azsphere device-group list
- azsphere device-group show
- azsphere device-group update
- azsphere device-group deployment create
- azsphere device-group deployment list
- azsphere device-group device list
- azsphere device-group device show-count
- azsphere image add
- azsphere image download
- azsphere image show
- azsphere image-package show
- azsphere product create
- azsphere product list
- azsphere product show
- azsphere product update
- azsphere product device list
- azsphere product device show-count
- azsphere product device-group list
- azsphere product device-group create-defaults
- azsphere role list
- azsphere role add
- azsphere role delete
- azsphere role show
- azsphere role show-types
- azsphere show-version
- azsphere show-user
- azsphere setting list
- azsphere setting no-color get
- azsphere setting no-color set
- azsphere tenant create
- azsphere tenant list
- azsphere tenant select
- azsphere tenant show-selected
- azsphere tenant update
Table output format
The table
format is the default format that prints output as an ASCII table, making it easy to read and scan. This format is best when you want a quick, human-searchable overview of data. It is useful for getting a summary of focused information, particularly for list commands.
azsphere tenant list --output table
------------------------------------ --------------------- -------------
Id Name Roles
========================================================================
143adbc9-1bf0-4be2-84a2-084a331d81cb MyTenant Contributor
------------------------------------ --------------------- -------------
768c2cd6-059a-49ad-9f53-89f5271cea15 MyTenant1 Administrator
Contributor
------------------------------------ --------------------- -------------
You can use the --query
parameter to customize the properties and columns you want to show in the output. The following example shows how to select just the TenantID and Role in the list command.
azsphere tenant list --query '[].{TenantID:id, Role:roles}'
------------------------------------ -------------
TenantID Role
==================================================
143adbc9-1bf0-4be2-84a2-084a331d81cb Contributor
------------------------------------ -------------
183adhc9-a5c8-8he2-84a2-c4f00f73a471 Administrator
Contributor
------------------------------------ -------------
Note
- Run the command in the JSON format to view the available property names to be used in the query. For example, when you run the
azsphere tenant list --output json
command, the output displays the names and values available for that command. - Nested objects, some keys, and fields are not printed in the table output by default. If you need to see these in your output, you can use the JMESPath re-keying feature to change the key name and avoid filtering. For more information about using queries to filter data, see Query CLI command output.
JSON output format
JSON output format includes all raw data and nested data in a structured format. We recommend using the JSON output for concise output and scripting purposes. This is only applicable when the command succeeds and returns 0.
The following example displays the list of tenants in the default JSON format.
azsphere tenant list --output json
[
{
"id": "143adbc9-1bf0-4be2-84a2-084a331d81cb",
"name": "MyTenant",
"roles": [
"Contributor"
]
},
{
"id": "768c2cd6-059a-49ad-9f53-89f5271cea15",
"name": "MyTenant1",
"roles": [
"Administrator",
"Contributor"
]
}
]
YAML output format
The yaml
format prints output as YAML, a plain-text data serialization format. YAML tends to be easier to read than JSON.
azsphere tenant list --output yaml
- id: 143adbc9-1bf0-4be2-84a2-084a331d81cb
name: MyTenant
roles:
- Contributor
- id: 768c2cd6-059a-49ad-9f53-89f5271cea15
name: MyTenant1
roles:
- Administrator
- Contributor
TSV output format
The tsv
output format returns tab-separated and newline-separated values without additional formatting, keys, or other symbols.
The tsv
output is similar to the table
output but differs in the following ways:
- Column headers are not displayed in the
tsv
output. - The
table
output displays list andtsv
displays the length of a list. - Nested objects are not printed in the
tsv
output. - The
tsv
output is tab separated and does not scale to fit the terminal.
azsphere tenant list --output tsv
143adbc9-1bf0-4be2-84a2-084a331d81cb MyTenant 1
768c2cd6-059a-49ad-9f53-89f5271cea15 MyTenant1 2