Skip to content

core: "az configure -d group=foo" doesn't apply when the group is an optional arg in the command #2703

@chrisdias

Description

@chrisdias

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions