-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
core: "az configure -d group=foo" doesn't apply when the group is an optional arg in the command #2703
Comments
It is by design at current moment, that the default is only applied when the We debated on this, and decide not to apply everywhere, otherwise you will never be able to list webs across subscription. I will leave this issue open for a while to accumulate a few more user voices. |
After using the defaults feature since it was released, I agree with @chrisdias. It's kind of strange to run a list command and not have it scoped to the default resource group. |
You could make the list commands accept |
@tjprescott I like that idea! |
@tjprescott What happens when |
It is feasible if we apply |
Is * ever a valid resource group? I would argue we'd apply * across all of our list/list-all folded commands. |
@yugangw-msft Irrespective if we add support for |
@lostintangent i agree, consistency is important here. Its confusing otherwise not knowing which commands support defaults and which do not. |
@chrisdias, the line is still clear, that when the group name is a mandatory field, the defaults will apply. If the group name is optional, that means the individual command has its |
Sorry, I guess its not clear to me when it is mandatory or not. For example, ~/src$ az appservice web list -h
Command
az appservice web list: List web apps.
Arguments
--resource-group -g: Name of resource group. You can configure the default group using 'az
configure --defaults group=<name>'.
... How do I know if it is required or not? |
@chrisdias, Agreed it is a ui gap. The arg description is not correct here. |
I've got three different sites in three different resource groups:
~/.azure$ az appservice web list -o table DefaultHostName Name ResourceGroup State Location AppServicePlan ------------------------------ ------------ --------------- ------- ---------- ----------------- paluffopizza.azurewebsites.net paluffopizza paluffopizza-rg Running West US WestUSPlan springqbr.azurewebsites.net SpringQBR QBRDemoRG Running West US thermocloud2-plan thermocloud2.azurewebsites.net thermocloud2 thermocloud2-rg Running West US thermocloud2-plan
I want to use the new configure --defaults option to default the resource group, so following the docs here: https://docs.microsoft.com/en-us/cli/azure/#configure I did the following
~/.azure$ az configure -d group=paluffopizza-rg
Now my expectation is that whenever I run a command i can omit the resource group and it will default to what I have configured. Instead, I see all of the sites:
~/.azure$ az appservice web list -o table DefaultHostName Name ResourceGroup State Location AppServicePlan ------------------------------ ------------ --------------- ------- ---------- ----------------- paluffopizza.azurewebsites.net paluffopizza paluffopizza-rg Running West US WestUSPlan springqbr.azurewebsites.net SpringQBR QBRDemoRG Running West US thermocloud2-plan thermocloud2.azurewebsites.net thermocloud2 thermocloud2-rg Running West US thermocloud2-plan
What i expect to see is the same thing as running this command:
~/.azure$ az appservice web list -g paluffopizza-rg -o table DefaultHostName Name ResourceGroup State Location AppServicePlan ------------------------------ ------------ --------------- ------- ---------- ---------------- paluffopizza.azurewebsites.net paluffopizza paluffopizza-rg Running West US WestUSPlan
The text was updated successfully, but these errors were encountered: