Skip to content

Add feedback message for API responses with HTTP 204 No Content in CLI commands #30463

@rosanch

Description

@rosanch

Related command
az acr private-endpoint-connection delete -r myRegistry -n anyValue

Is your feature request related to a problem? Please describe.
When the API returns an HTTP 204 No Content status code, the lack of any output can be misleading to the user. It may give the impression that the resource was successfully deleted, even though no resource was actually affected. This is particularly confusing when 204 is used instead of a more intuitive 404 for non-existent resources.

Describe the solution you'd like
Print a warning in such cases, such as "Warning: No content" or "Warning: No resource was deleted." This would help clarify to the user that the command did not perform any deletion, even though the API response was not an error.

Describe alternatives you've considered
The only alternative would be if ARM enforced the use of 404 instead of 204 in these scenarios, which is outside the CLI's scope of control. A client-side message remains the most practical solution.

Additional context
This issue is not limited to this specific command; it can impact any command interacting with APIs that return 204 status codes.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions