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

[Question] Expected flow for identifying resource types when using table-based output #1039

Closed
lostintangent opened this issue Oct 6, 2016 · 6 comments
Assignees

Comments

@lostintangent
Copy link
Member

lostintangent commented Oct 6, 2016

Note: As I was writing out this bug, I realized the mentioned workaround, but I've left the original text in place in order to articulate my experience in case that is valuable.


I was trying to run the az resource show command on a function app instance, and I wasn't able to figure out how to correctly determine the value to provide to the required --resource-type flag. Running az resource list easily provided the name and resource group values, but it's somewhat confusing that it displays a "Kind" value, which doesn't seem to correlate to the --resource-type flag? I tried appending "Microsoft.Web/" to the "kind" that was displayed via the az resource list command (i.e. "functionapp"), but that also didn't work. In the end, I went into the Azure portal, and viewed the "underlying" ARM template in order to determine that the type is actually "Microsoft.Web/sites".

Once I was using that value, az resource show worked as expected, however, I couldn't help but feel like I'm clearly missing something. Is there a command to determine the list of appropriate type names? I found that az resource provider list showed me the list of providers (called "namespaces" in the help text for the --resource-type flag?), but I wasn't able to determine the list of available types/kinds within that provider via az resource show.

In the end, I realized that I was probably only getting a subset of the available metadata from the az resource list command, due to having configured the CLI to default to table-based output, so I ran az resource list --output json and saw the correct resource type value.

Maybe I'm the only person that would get confused by this, but as a topic of conversation, I wonder whether it wouldn't be valuable to consider one or more of the following:

  1. Display an example of what the resource type value should be in the command help text, to provide some kind of indication as to what it is. If someone wasn't familiar with ARM concepts, would they know what / is? Maybe, I'm not sure.
  2. Display the resource type in the table-based output of the az resource list command. It seems like this value is important, since it's a required param to the detail counterpart of the resource list command, so maybe it's worth promoting to the table?
  3. Provide some kind of indication somewhere as to how to acquire the resource type value. Doing Add current directory to search path to allow load of modules without… #2 would probably be sufficient, but in the absence of that, maybe it would be worth having some kind of help text in the az resource show (and others?) command to point users in the right direction.
@mayurid
Copy link
Member

mayurid commented Oct 6, 2016

Thanks @lostintangent. This is very valid feedback and has been on our radar.
We will definitely do #1 as that's an easy way to show the user what the value will look like. Along with that we are looking into doing a couple more things:-

  1. Per ARM Component Omnibus #1033 we are looking into having auto-complete on the resource-type to help the user
  2. arm: 'resource show' should work with resource id #806: looking into getting it work simply with resource id.

Let us know how you would feel once with these are done?
Also adding @yugangw-msft to continue to look at this space to make it better

@derekbekoe
Copy link
Member

Thanks for the feedback.
For (2), table output hides IDs and types by default as ids aren't table-friendly and types are typically not needed. e.g. az vm list -otable would show Microsoft.Compute/virtualMachines in each row of the table.
However, this is a special case where showing types in table output would be useful.
Related to #1003 but that's for IDs.

@lostintangent
Copy link
Member Author

@mayurid The auto-complete option and help text sounds awesome!

@derekbekoe I can totally appreciate trying to curate the table display to just the core data. In this case, it seems like the resource type is pretty core, so I'd vote for something along the lines of #1040 :)

Thanks for the prompt response, and keep up the awesome work on the product!

@johanste
Copy link
Member

johanste commented Oct 7, 2016

Ummm, yeah, we really should show the type property for table output for resource list...

And, yes, it is really unfortunate that the taxonomy is different between the property names of returned resources and parameter names in the CLI commands (and, for that matter, in the SDK). We should take a look to see what we can do there as well!

@johanste
Copy link
Member

johanste commented Oct 7, 2016

And while we certainly should provide tab completion whenever possible, I don't think we should ever have tab completion as the only way to get the possible set of input values...

@lostintangent
Copy link
Member Author

I'm closing this issue since the Type value has been added to the az resource list table, and I just verified it in the nightly bits. Thanks for the prompt response!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants