Azure / Azure/azure-cli-extensions

`az network bastion rdp` fails: KeyError: 'enableTunneling'

Open
#8,799 2 comments 0 reactions 1 assignee Claimed by @necusjz View on GitHub
Auto-Assign bug Network Network - Bastion Service Attention
Dominant language
Python
Stars
454
Forks
1.7k
Avg merge
2d 19h
Merged PRs (30d)
64

Description

### Describe the bug

See https://github.com/Azure/azure-cli/issues/31479#issuecomment-2909036861

### Related command

`az network bastion rdp`

### Errors

KeyError: 'enableTunneling'

### Issue script & Debug output

```
> az network bastion rdp --name xxx --resource-group xxx --target-resource-id "/subscriptions/xxx/resourceGroups/xxx/providers/Microsoft.Compute/virtualMachines/xxx"
The command failed with an unexpected error. Here is the traceback:
'enableTunneling'
Traceback (most recent call last):
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/cli.py", line 233, in invoke
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 666, in execute
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 734, in _run_jobs_serially
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 703, in _run_job
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 336, in call
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/command_operation.py", line 120, in handler
File "C:\Users\xxx\cliextensions\bastion\azext_bastion\custom.py", line 297, in rdp_bastion_host
bastion['enableTunneling'] is not True:
~~~~~~~^^^^^^^^^^^^^^^^^^^
KeyError: 'enableTunneling'
To check existing issues, please visit: https://github.com/Azure/azure-cli/issues
```

### Expected behavior

Success.

### Environment Summary

```
azure-cli 2.72.0

core 2.72.0
telemetry 1.1.0

Extensions:
bastion 1.4.0

Dependencies:
msal 1.32.3
azure-mgmt-resource 23.1.1

Python location 'C:\Program Files\Microsoft SDKs\Azure\CLI2\python.exe'
Config directory 'C:\Users\xxx\.azure'
Extensions directory 'C:\Users\xxx\.azure\cliextensions'

Python (Windows) 3.12.8 (tags/v3.12.8:2dc476b, Dec 3 2024, 19:30:04) [MSC v.1942 64 bit (AMD64)]
```

### Additional context

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.