-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[Keyvault] az keyvault create/import: Add --default-data-disk-policy to support new default SKR policy
#32538
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
Conversation
…t new default SKR policy
️✔️AzureCLI-FullTest
|
|
| rule | cmd_name | rule_message | suggest_message |
|---|---|---|---|
| keyvault key create | cmd keyvault key create added parameter default_data_disk_policy |
||
| keyvault key import | cmd keyvault key import added parameter default_data_disk_policy |
|
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.
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 adds a new parameter --default-data-disk-policy to the az keyvault key create and az keyvault key import commands to support a new Secure Key Release (SKR) policy scenario for data disk encryption. This complements the existing --default-cvm-policy parameter which supports CVM disk encryption.
Key Changes:
- Added
--default-data-disk-policyparameter alongside existing--default-cvm-policy - Refactored
_fetch_default_cvm_policyto generic_fetch_default_release_policyfunction that supports both policy types - Implemented mutual exclusivity validation between the two default policy options
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| _params.py | Adds --default-data-disk-policy parameter definition for key create/import commands |
| _validators.py | Refactors policy fetching logic to support both CVM and data disk policy types, adds mutual exclusivity validation between policy options |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/azure-cli/azure/cli/command_modules/keyvault/_validators.py
Outdated
Show resolved
Hide resolved
src/azure-cli/azure/cli/command_modules/keyvault/_validators.py
Outdated
Show resolved
Hide resolved
src/azure-cli/azure/cli/command_modules/keyvault/_validators.py
Outdated
Show resolved
Hide resolved
| c.extra('default_data_disk_policy', action='store_true', | ||
| help='Use default policy under which the key can be exported for data disk encryption.') |
Copilot
AI
Dec 15, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new --default-data-disk-policy parameter lacks test coverage. The existing test test_keyvault_hsm_key_release_policy only tests the --default-cvm-policy flag. Consider adding test cases for the new --default-data-disk-policy parameter to verify its functionality and ensure it generates the correct policy structure.
Related command
az keyvault create/importDescription
We previously supported
--default-cvm-policyfor key creation/import, but now we have a new scenario which requires new SKR policy for data disk encryption, so this PR adds new parameter--default-data-disk-policyTesting Guide
az keyvault key create --default-data-disk-policyHistory Notes
[Component Name 1] BREAKING CHANGE:
az command a: Make some customer-facing breaking change[Component Name 2]
az command b: Add some customer-facing featureThis checklist is used to make sure that common guidelines for a pull request are followed.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.
I adhere to the Error Handling Guidelines.