Enable SSH connectivity for Developer SKU#8852
Conversation
️✔️Azure CLI Extensions Breaking Change Test
|
|
Hi @anvrao1, |
|
Thank you for your contribution! We will review the pull request and get back to you soon. |
|
The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR. Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions). pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>
|
There was a problem hiding this comment.
Pull Request Overview
This PR enables SSH connectivity for the Developer SKU by replacing the direct SKU and tunneling check with a unified helper function.
- Introduce
_is_nativeclient_enabledto allow Developer SKU by default and preserve existing checks for Standard/Premium. - Replace the original SKU-plus-tunneling conditional with a call to the new helper.
- Retain the error-raising logic, now backed by the helper function.
Comments suppressed due to low confidence (2)
src/bastion/azext_bastion/custom.py:184
- The exception message still references only Standard or Premium SKUs, but Developer SKU is now supported; consider updating it to mention Developer support explicitly.
raise ClientRequestError('Bastion Host SKU must be Standard or Premium and Native Client must be enabled.')
src/bastion/azext_bastion/custom.py:390
- Add unit tests for
_is_nativeclient_enabledto cover the Developer SKU path and verify behavior across all supported SKUs.
def _is_nativeclient_enabled(bastion):
| return ( | ||
| True if bastion['sku']['name'] == BastionSku.Developer.value | ||
| else (bastion['enableTunneling']) if _is_sku_standard_or_higher(bastion['sku']['name']) | ||
| else False | ||
| ) |
There was a problem hiding this comment.
[nitpick] The nested ternary conditional within _is_nativeclient_enabled is hard to follow; refactor it into a clear if/elif/else block for better readability.
| return ( | |
| True if bastion['sku']['name'] == BastionSku.Developer.value | |
| else (bastion['enableTunneling']) if _is_sku_standard_or_higher(bastion['sku']['name']) | |
| else False | |
| ) | |
| if bastion['sku']['name'] == BastionSku.Developer.value: | |
| return True | |
| elif _is_sku_standard_or_higher(bastion['sku']['name']): | |
| return bastion['enableTunneling'] | |
| else: | |
| return False |
CodeGen Tools Feedback CollectionThank you for using our CodeGen tool. We value your feedback, and we would like to know how we can improve our product. Please take a few minutes to fill our codegen survey |
|
|
/azp run |
|
Azure Pipelines successfully started running 2 pipeline(s). |
|
@anvrao1 plz execute |
This PR enables SSH connectivity for the Developer SKU by replacing the direct SKU and tunneling check with a unified helper function.
Introduce _is_nativeclient_enabled to allow Developer SKU by default and preserve existing checks for Standard/Premium.
Replace the original SKU-plus-tunneling conditional with a call to the new helper.
Retain the error-raising logic, now backed by the helper function.
Related command
General Guidelines
azdev style <YOUR_EXT>locally? (pip install azdevrequired)python scripts/ci/test_index.py -qlocally? (pip install wheel==0.30.0required)For new extensions:
About Extension Publish
There is a pipeline to automatically build, upload and publish extension wheels.
Once your pull request is merged into main branch, a new pull request will be created to update
src/index.jsonautomatically.You only need to update the version information in file setup.py and historical information in file HISTORY.rst in your PR but do not modify
src/index.json.