"Does repair vm requires public ip" No opion does not work
Describe the bug
I did 「az vm repair create -g rgname -n vmname --repair-username username --repair-password passwordinfo --enable-nested --verbose」with prompt 「"Does repair vm requires public ip" No」. However public ip has been assigned on repair vm even though I set「"Does repair vm requires public ip" No」
We can repro easily.
Upon checking the az vm repair debug logs internal "az vm create" command set --public-ip-address repair-vm-wins_PublicIP. I think should be set --public-ip-address "" in the case user set「"Does repair vm requires public ip" No」.
Related command
https://github.com/Azure/azure-cli-extensions/commit/ea4af4cfcc92009c49949259c6c883f9171d7a3d
az vm repair create -g rgname -n vmname --repair-username username --repair-password passwordinfo --enable-nested --verbose
Errors
No error. "Does repair vm requires public ip" No opion does not work
Issue script & Debug output
Debug log
=== cli.azext_vm_repair.repair_utils: Creating repair VM with command: az vm create -g repair-vm-winsvr-2019-01-20250205004741 -n repair-vm-wins_ --tag repair_source=*** --image MicrosoftWindowsServer:WindowsServer:2022-datacenter-smalldisk:20348.3091.250112 --admin-username *** --admin-password *** --public-ip-address repair-vm-wins_PublicIP --size Standard_D2s_v3 cli.azext_vm_repair.repair_utils: copy_disk_id: *** cli.azext_vm_repair.repair_utils: fix_uuid: False cli.azext_vm_repair.repair_utils: Validating VM template before continuing... cli.azext_vm_repair.repair_utils: Calling: az vm create -g repair-vm-winsvr-2019-01-20250205004741 -n repair-vm-wins_ --tag repair_source=*** --image MicrosoftWindowsServer:WindowsServer:2022-datacenter-smalldisk:20348.3091.250112 --admin-username ******** --admin-password ******** --public-ip-address repair-vm-wins_PublicIP --size Standard_D2s_v3 --attach-data-disks *** --validate cli.azext_vm_repair.repair_utils: Success.
cli.azext_vm_repair.repair_utils: Creating repair VM... cli.azext_vm_repair.repair_utils: Calling: az vm create -g repair-vm-winsvr-2019-01-20250205004741 -n repair-vm-wins_ --tag repair_source=*** --image MicrosoftWindowsServer:WindowsServer:2022-datacenter-smalldisk:20348.3091.250112 --admin-username ******** --admin-password ******** --public-ip-address repair-vm-wins_PublicIP --size Standard_D2s_v3 --attach-data-disks *** cli.azext_vm_repair.repair_utils: Success.
Expected behavior
Public IP should not be set on repair vm when the user set prompt "Does repair vm requires public ip" :NO
Environment Summary
Most recent version in Azure cloudshell
PS /home/nobumasa> az version
{
"azure-cli": "2.68.0",
"azure-cli-core": "2.68.0",
"azure-cli-telemetry": "1.1.0",
"extensions": {
"ai-examples": "0.2.5",
"ml": "2.33.1",
"ssh": "2.0.6"
}
}
Additional context
Related source code are here. https://github.com/Azure/azure-cli-extensions/blob/main/src/vm-repair/azext_vm_repair/repair_utils.py#L802 https://github.com/Azure/azure-cli-extensions/blob/main/src/vm-repair/azext_vm_repair/_validators.py#L227 https://github.com/Azure/azure-cli-extensions/blob/main/src/vm-repair/azext_vm_repair/custom.py#L154
Thank you for opening this issue, we will look into it.
This module is actually owned by service team. Hi @Sandido could you please take a look at this issue?
@Sandido @yanzhudd @yonzhan This is just a gentle reminder. I am glad if the feature improved.
Thanks for the feedback! We recently added this functionality and will be verifying.
This is still broken. You can see here that even with n selected, its still building a "repair-" public IP. Its breaking troubleshooting as customers with DENY PUBLIC IP CREATIONs will break this command: