question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:12 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
tjprescottcommented, Apr 3, 2017

You could make the list commands accept --resource-group * to list all within the subscription. That wouldn’t require much more logic but still allow you to use the default RG.

0reactions
yugangw-msftcommented, Apr 3, 2017

@chrisdias, Agreed it is a ui gap. The arg description is not correct here.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Named and Optional Arguments - C# Programming Guide
Named and optional arguments enable you to omit the argument for an optional parameter if you don't want to change the parameter's default ......
Read more >
Optional argument in command with click - Stack Overflow
In this case we over ride click.Group.parse_args() and if the first parameter matches a command and the second parameter does not, then we ......
Read more >
ONTAP Command Reference
Description. The redo command re-executes a command that has been executed previously in the current CLI session.
Read more >
Azure arm - Builders | Packer - HashiCorp Developer
Knowing the resource group and VM name allows one to execute commands to update the VM during a Packer build, e.g. attach a...
Read more >
NX Nastran User's Guide - Siemens PLM
In NX Nastran, you can use the SET Case Control command to identify a group of grid points and/or elements as a specific...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found