Display device information

An Azure Sphere tenant can contain thousands of devices, and managing the devices requires a method to obtain detailed information about each of them. Using the CLI commands, you can list information about devices, products, and device groups in a tenant. You can also redirect the standard output of a command to a file for detailed review.

You can also use the CLI commands to download diagnostic and configuration information, data about the errors, and other events that affect your devices.

Redirect or paginate results

The Azure Sphere command-line interface (CLI) provides the following commands to list information about the devices, products, and device groups in a tenant.

These commands can return a large list of items which can be redirected or paginated. This section describes the different ways to redirect or paginate output from both CLIs.

Azure Sphere CLI

Azure Sphere CLI does not support interactive pagination. You can, however, paginate the output on screen by piping to existing pagination tools.

For example:

  • In PowerShell (Windows): azsphere device list | Out-Host –Paging
  • At a command prompt (Windows): azsphere device list | more
  • In Bash shell (Linux): azsphere device list | less

Note

This operation can potentially be slow depending on how much data is returned.

You can also redirect the standard output of a command to a file. In the following example, the standard output is sent to output.txt and the standard error is sent to logs.txt.

azsphere device list --verbose > output.txt 2> logs.txt

Azure Sphere Classic CLI

The default action of these commands is to return a page of records at one time, where the page size is typically set to 100 records. At the bottom of each page of results is a message to press any key to continue the display with the next page of results. Page size is adjusted automatically based on factors such as database activity and available network bandwidth.

You can redirect the results of a list command to a comma-separated values (CSV) file for in-depth review by specifying a path and file name for --output parameter and adding the --noninteractive parameter to the command. The --noninteractive parameter removes the pagination from the results so the entire list is captured in the CSV file without the need to manually continue at the end of each page.

Display information for support

The commands used to obtain support information will depend on whether you are gathering customer support data for a single Azure Sphere device when working with Microsoft support, or returning data on error conditions involving the applications running on devices within a tenant. In most scenarios, you will be querying the tenant for error conditions on all devices using the azsphere tenant download-error-report command. This method will depend on the Azure Sphere Security Service communication with the devices through an internet connection to gather the matching events.

get-support-data

The azsphere get-support-data command gathers and generates log files containing diagnostic and configuration information from your computer, the cloud, and the attached Azure Sphere device. The information in these log files can be used to help you or the technical support team to analyze and troubleshoot problems. Use the --destination parameter to specify the path and filename of the .zip file in which to save the support data. You can provide a relative or absolute path.

download-error-report

The azsphere tenant download-error-report command returns information on errors reported by devices within a tenant. Event data is pulled from the Azure Sphere Security Service cloud and does not require a physical connection to a particular device. The command works in the context of the current tenant and returns error reports for all devices within that tenant.

Use the --destination parameter to specify the path and filename of the .csv file in which to save the support data. You can provide a relative or absolute path.