Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Address bastion native client Issues and add proper error messages #7555

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/bastion/azext_bastion/custom.py
Expand Up @@ -319,9 +319,12 @@ def rdp_bastion_host(cmd, target_resource_id, target_ip_address, resource_group_


def _is_ipconnect_request(bastion, target_ip_address):
if 'enableIpConnect' in bastion and bastion['enableIpConnect'] is True and target_ip_address:
return True

if target_ip_address:
if 'enableIpConnect' in bastion and bastion['enableIpConnect'] is True:
return True
err_msg = "`--target-ip-address` flag cannot be used when IpConnect is not enabled. " \
"Please use --target-resource-id flag instead."
raise InvalidArgumentValueError(err_msg)
return False


Expand Down