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.
- ID: 355a594a-22ef-fd15-0b58-07701dd1815c
- Version Independent ID: d8356a0a-9aaf-900b-ce7a-021c9a0af509
- Content: az vm repair
- Content Source: latest/docs-ref-autogen/vm/repair.yml
- Service: virtual-machines
- GitHub Login: @rloutlaw
- Microsoft Alias: routlaw
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 20 (3 by maintainers)
acked. Looking into it .