-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[IoT] Error handling of Hubs missing default storage endpoint #20595
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…t storage endpoint
src/azure-cli/azure/cli/command_modules/iot/tests/latest/test_iot_commands.py
Show resolved
Hide resolved
src/azure-cli/azure/cli/command_modules/iot/tests/latest/test_iot_commands.py
Outdated
Show resolved
Hide resolved
| raise AzCLIError('This hub has no default storage endpoint for file upload.\n' | ||
| 'Please recreate your default storage endpoint by running ' | ||
| '`az iot hub update --name {hub_name} --fcs {storage_connection_string} --fc {storage_container_name}`') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we use the UserFault instead of AzCLIError ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure - this one's a bit tough because I'm not sure what the correct error class would be - technically it is a user fault for trying to modify a storage endpoint that doesn't exist, but in the context of the command, the fault would be an RequiredArgumentMissingError.
For the time being we can classify it as an UnclassifiedUserFault since it's more complicated than just incorrect arguments or a misconfigured resource.
|
@zhoxing-ms Can we get this into the current milestone targeted for a January release? |
|
@c-ryan-k OK, this PR has been merged and will be released on 2022-01-04 |
Description
This PR fixes a bug where a hub without a default storage endpoint cannot be updated with
az iot hub update, and also shows an error if the user attempts to update file upload settings on a hub missing this required endpoint.Fixes #20004
Testing Guide
If your hub has no default storage endpoint (
properties.storageEndpoints[$default]), you should still be able to update other properties of the hub usingaz iot hub update [--param or --set], however if you attempt to update file-upload endpoint-specific settings (container name, connection string, sas_ttl, identity, etc), you will receive the following error:This hub has no default storage endpoint for file upload.Please recreate your default storage endpoint by running "az iot hub update --name {hub_name} --fcs {storage_connection_string} --fc {storage_container_name}"History Notes
[IoT] az iot hub update: Adds error handling for file-upload parameters and fixes empty $default storage endpoint errors
This checklist is used to make sure that common guidelines for a pull request are followed.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.
I adhere to the Error Handling Guidelines.