Azure / Azure/azure-iot-cli-extension
[bug] az iot hub state export fails while saving exported data to the file
- Dominant language
- Python
- Stars
- 88
- Forks
- 78
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 9
Description
**Describe the bug**
We executed the following command:
` az iot hub state export --hub-name IotHubName --state-file ./IotHubName -state.json`
The whole process took more than 3 hours, and +or- 53K devices got exported.
Once all of them were exported, a python exception was thrown while saving the state to the file.
All the exported data was lost.
**Expected behavior**
Exported data is saved.
**Screenshots**

Contributor guide
Research direction
Start by reproducing the `az iot hub state export` command with a state file and inspect the export command's save-to-file path, using the reported Python exception as the failure point. Done means the complete device state is written successfully after a long export, without losing the exported data.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, python
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100