This script can be used to get or set crash dump policy by making GET
or PATCH
calls to the Azure Sphere API to view or modify the AllowCrashDumpsCollection
value for one or many device groups.
File/folder | Description |
---|---|
crashdumps_configure.py | main Python script |
LICENSE.txt | License text for this script |
README.md | This readme file |
requirements.txt | List of pip requirements (see Setup section) |
- This script can be run on Windows, Mac, or Linux. It does not depend on the Azure Sphere SDK or azsphere CLI.
- An internet connection
python
(3.x) andpip
Install the dependencies
pip install -r requirements.txt
$ python crashdumps_configure.py -h
usage: crashdumps_configure.py [-h] [--get] [--set {on,off}]
[--tenantid TENANTID]
[--devicegroupid DEVICEGROUPID [DEVICEGROUPID ...]]
[--verbose] [--forceinteractive] [--nocache]
Get or set crash dump policy
optional arguments:
-h, --help show this help message and exit
--get Get AllowCrashDumpsCollection
--set {on,off} Set AllowCrashDumpsCollection
--tenantid TENANTID, -t TENANTID
Tenant id for which to get or set
AllowCrashDumpsCollection
--devicegroupid DEVICEGROUPID [DEVICEGROUPID ...], -dg DEVICEGROUPID [DEVICEGROUPID ...]
Device group ids (separated by a space) for which to
get or set AllowCrashDumpsCollection
--verbose, -v Enable verbose logging
--forceinteractive Force interactive auth instead of trying to load a
token from the cache
--nocache Don't cache an (encrypted) access token in a file in
the current directory
Here are some examples to show how to use the script.
python crashdumps_configure.py --get
python crashdumps_configure.py --get --tenantid xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
python crashdumps_configure.py --get --tenantid xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx --devicegroupid yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy
python crashdumps_configure.py --get --tenantid xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx --devicegroupid yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy zzzzzzzz-zzzz-zzzz-zzzz-zzzzzzzzzzzz
python crashdumps_configure.py --set on
python crashdumps_configure.py --set on --tenantid xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
python crashdumps_configure.py --set on --tenantid xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx --devicegroupid yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy
python crashdumps_configure.py --set on --tenantid xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx --devicegroupid yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy zzzzzzzz-zzzz-zzzz-zzzz-zzzzzzzzzzzz
python crashdumps_configure.py --set off
python crashdumps_configure.py --set off --tenantid xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
python crashdumps_configure.py --set off --tenantid xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx --devicegroupid yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy
python crashdumps_configure.py --set off --tenantid xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx --devicegroupid yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy zzzzzzzz-zzzz-zzzz-zzzz-zzzzzzzzzzzz
- Note that you must select a user account that has the Administrator role in your Azure Sphere tenant to run the
--set
command. Any role will work for the--get
command. - A 500 (Internal Server Error) response when updating the
AllowCrashDumpsCollection
field usually indicates a transient error. We recommend that you retry the operation in this case.
- For more information on Azure Sphere crash dumps, see Configure crash dumps
- For more information on how Azure Sphere classifies diagnostic data, see Overview of diagnostic data types
- By default, this script will store a file named 'token_cache' in your current directory that contains an (encrypted) access token for accessing the Azure Sphere API. This file will be decrypted on future runs to streamline authentication. You can disable this feature by passing that
--nocache
command line argument.
There is no official support guarantee for this code, but we will make a best effort to respond to/address any issues you encounter.
If you run into an issue with this script, please open a GitHub issue against this repo.
For information about the licenses that apply to this script, see LICENSE.txt