azure-cli: Repair script fails to find Resource Group even though the name is an exact match

Extension name (the extension in question)

az vm repair

Description of issue (in as much detail as possible)

A colleague reached out and let me know when he ran az vm repair, it was unable to locate the Resource Group even though the name was accurate. The exact error was (ResourceGroupNotFound) Resource group 'APP_SHARED_STAGE' could not be found.

  • Confirmed the context was correct with Set-AzContext
  • Tried copying the RG name
  • Tried typing it manually
  • Also tried to pass in the RG name via the following script:
$rg = Get-AzResourceGroup "APP_SHARED_STAGE" #confirmed $rg returned Resource Group in question
az vm repair create -g $rg.ResourceGroupName -n NAMEOFVM --enabled-nested --verbose

The RG name was “APP_SHARED_STAGE”. Another colleague and I had the script fail on an RG with underscores in it months ago but I saved no information thinking it was a one-off issue. Could it be a string parsing issue when it comes to RG names with underscores?


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 20 (3 by maintainers)

Most upvoted comments

acked. Looking into it .