Skip to content

Commit a69445a

Browse files
authored
Enable ssh connectivity for dev sku (#8856)
* Enable ssh connectivity for dev sku * Fix tests
1 parent e33e35c commit a69445a

File tree

5 files changed

+1147
-1076
lines changed

5 files changed

+1147
-1076
lines changed

src/bastion/HISTORY.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
33
Release History
44
===============
5+
1.4.1
6+
++++++
7+
* Enable SSH connectivity support for Developer SKU.
8+
59
1.4.0
610
++++++
711
* Add support for bastion developer create.

src/bastion/azext_bastion/custom.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,7 @@ def ssh_bastion_host(cmd, auth_type, target_resource_id, target_ip_address, reso
180180
if not resource_port:
181181
resource_port = 22
182182

183-
if _is_sku_standard_or_higher(bastion['sku']['name']) is not True or \
184-
bastion['enableTunneling'] is not True:
183+
if not _is_nativeclient_enabled(bastion):
185184
raise ClientRequestError('Bastion Host SKU must be Standard or Premium and Native Client must be enabled.')
186185

187186
ip_connect = _is_ipconnect_request(bastion, target_ip_address)
@@ -389,6 +388,14 @@ def _is_sku_standard_or_higher(sku):
389388
return sku in allowed_skus
390389

391390

391+
def _is_nativeclient_enabled(bastion):
392+
if bastion['sku']['name'] == BastionSku.Developer.value:
393+
return True
394+
if _is_sku_standard_or_higher(bastion['sku']['name']):
395+
return bastion['enableTunneling']
396+
return False
397+
398+
392399
def handle_error_response(response):
393400
try:
394401
errorMessage = json.loads(response.content).get('message', None)

0 commit comments

Comments
 (0)