Skip to content
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

Inconsistent return value for "exists" commands #21822

Open
tbirk-bhs opened this issue Mar 28, 2022 · 5 comments
Open

Inconsistent return value for "exists" commands #21822

tbirk-bhs opened this issue Mar 28, 2022 · 5 comments
Assignees
Labels
Auto-Assign Auto assign by bot customer-reported Issues that are reported by GitHub users external to the Azure organization. feature-request Storage az storage
Milestone

Comments

@tbirk-bhs
Copy link

This is autogenerated. Please review and update as needed.

Describe the bug

Command Name
az storage container exists

Errors:
The command return json with

{
  "exists": true
}

When I use "az group exists" I only get

true

as result.

Also this command should return just true/false and not json. (Or the the "az group exists" command should return also json)

To Reproduce:

Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.

  • Put any pre-requisite steps here...
  • az storage container exists -n {} --account-name {}

Expected Behavior

true/false instead of json object

Environment Summary

macOS-12.2.1-x86_64-i386-64bit, Darwin 21.3.0
Python 3.10.2
Installer: HOMEBREW

azure-cli 2.34.1

Extensions:
monitor-control-service 0.2.0
log-analytics-solution 0.1.1
ssh 1.0.0
scheduled-query 0.5.0

Dependencies:
msal 1.16.0
azure-mgmt-resource 20.0.0

Additional Context

@ghost ghost added customer-reported Issues that are reported by GitHub users external to the Azure organization. Storage az storage labels Mar 28, 2022
@ghost ghost added this to the Backlog milestone Mar 28, 2022
@ghost ghost assigned evelyn-ys Mar 28, 2022
@ghost ghost added Auto-Assign Auto assign by bot ARM az resource/group/lock/tag/deployment/policy/managementapp/account management-group labels Mar 28, 2022
@ghost ghost assigned zhoxing-ms Mar 28, 2022
@ghost ghost added VM SSH CXP Attention This issue is handled by CXP team. SSH labels Mar 28, 2022
@yonzhan
Copy link
Collaborator

yonzhan commented Mar 28, 2022

storage

@yonzhan yonzhan removed ARM az resource/group/lock/tag/deployment/policy/managementapp/account management-group SSH VM SSH CXP Attention This issue is handled by CXP team. labels Mar 28, 2022
@evelyn-ys
Copy link
Member

Hi @tbirk-bhs, thanks for reaching out.

It's really good suggestion to keep all return format consistent. CLI consists of several modules, for example, az storage container exists is from storage module, az group exists is from resource module. Some modules are owned by CLI team and some are owned by each service team. Difficulties do exist to keep all modules consistent.

If any of the current return format is changed, it will be breaking change and customers using CLI in scripts or pipelines will be break. So we should be very cautious for any breaking change.

Thanks for your suggestion and we will take into consideration!

@tbirk-bhs
Copy link
Author

Hi @evelyn-ys,

thank you for your quick reply. Changing this default behavior will create a breaking change, yes.
Maybe it would be a agreement to respect the --output json parameter and return even for

az group exists -n <my resourcegroup> --output json

a valid json object? Currently only true/false is returned.

@evelyn-ys
Copy link
Member

@zhoxing-ms What do you think as az group exists owner?

@zhoxing-ms
Copy link
Contributor

In fact, the --output parameter already exists as a global parameter and has the meaning of changing the output format, so it cannot be used to convert the return results.
If we use another parameter (such as --exists-output) to realize the conversion return results, I personally think it may not be convenient enough for users. @chasewilson Do you have any suggestions for this design question?

CLI consists of several modules, for example, az storage container exists is from storage module, az group exists is from resource module. Some modules are owned by CLI team and some are owned by each service team. Difficulties do exist to keep all modules consistent.

Personally, I think it's a great suggestion to keep the output format consistent, but as the reasons mentioned by @evelyn-ys, it's really difficult to keep the return format of all the exists commands unified at present

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Assign Auto assign by bot customer-reported Issues that are reported by GitHub users external to the Azure organization. feature-request Storage az storage
Projects
None yet
Development

No branches or pull requests

4 participants