Skip to content

Enable SSH connectivity for Developer SKU#8852

Closed
anvrao1 wants to merge 3 commits intoAzure:mainfrom
anvrao1:anvrao/devfixssh
Closed

Enable SSH connectivity for Developer SKU#8852
anvrao1 wants to merge 3 commits intoAzure:mainfrom
anvrao1:anvrao/devfixssh

Conversation

@anvrao1
Copy link
Copy Markdown
Member

@anvrao1 anvrao1 commented Jun 10, 2025


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

  • Have you run azdev style <YOUR_EXT> locally? (pip install azdev required)
  • Have you run python scripts/ci/test_index.py -q locally? (pip install wheel==0.30.0 required)
  • My extension version conforms to the Extension version schema

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.json automatically.
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.

Copilot AI review requested due to automatic review settings June 10, 2025 19:35
@azure-client-tools-bot-prd
Copy link
Copy Markdown

azure-client-tools-bot-prd bot commented Jun 10, 2025

️✔️Azure CLI Extensions Breaking Change Test
️✔️Non Breaking Changes

@azure-client-tools-bot-prd
Copy link
Copy Markdown

Hi @anvrao1,
Please write the description of changes which can be perceived by customers into HISTORY.rst.
If you want to release a new extension version, please update the version in setup.py as well.

@yonzhan
Copy link
Copy Markdown
Collaborator

yonzhan commented Jun 10, 2025

Thank you for your contribution! We will review the pull request and get back to you soon.

@github-actions
Copy link
Copy Markdown
Contributor

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).
After that please run the following commands to enable git hooks:

pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_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.
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_enabled to cover the Developer SKU path and verify behavior across all supported SKUs.
def _is_nativeclient_enabled(bastion):

Comment thread src/bastion/azext_bastion/custom.py Outdated
Comment on lines +391 to +395
return (
True if bastion['sku']['name'] == BastionSku.Developer.value
else (bastion['enableTunneling']) if _is_sku_standard_or_higher(bastion['sku']['name'])
else False
)
Copy link

Copilot AI Jun 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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.

Suggested change
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

Copilot uses AI. Check for mistakes.
@github-actions
Copy link
Copy Markdown
Contributor

CodeGen Tools Feedback Collection

Thank 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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jun 10, 2025

@github-actions github-actions bot added the release-version-block Updates do not qualify release version rules. NOTE: please do not edit it manually. label Jun 10, 2025
@github-actions github-actions bot removed the release-version-block Updates do not qualify release version rules. NOTE: please do not edit it manually. label Jun 10, 2025
@yonzhan yonzhan requested review from jsntcy and necusjz June 10, 2025 23:01
@necusjz
Copy link
Copy Markdown
Member

necusjz commented Jun 10, 2025

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 2 pipeline(s).

@necusjz
Copy link
Copy Markdown
Member

necusjz commented Jun 11, 2025

@anvrao1 plz execute azdev setup based on the latest dev branch of azure-cli repo.

@anvrao1 anvrao1 closed this Jun 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants