[PS] Migrate DataProtection module to autorest v4 after <Added support for DPP vault soft delete feature>#29122
[PS] Migrate DataProtection module to autorest v4 after <Added support for DPP vault soft delete feature>#29122JunKai-v wants to merge 15 commits intoAzure:mainfrom
Conversation
| Thanks for your contribution! The pull request validation has started. Please revisit this comment for updated status. |
There was a problem hiding this comment.
Pull request overview
This PR migrates the DataProtection module from AutoRest v3 to v4, implementing support for DPP vault soft delete features. The migration involves substantial changes across help documentation, code model namespaces, and parameter signatures.
Changes:
- Migrated from AutoRest v3 to v4 by removing
use-extensiondirective in README.md - Updated model namespaces from
Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20250901toMicrosoft.Azure.PowerShell.Cmdlets.DataProtection.Models - Changed identity-related parameters in vault cmdlets (replaced
-IdentityTypeand-IdentityUserAssignedIdentitywith-EnableSystemAssignedIdentityand-UserAssignedIdentity) - Regenerated help documentation with updated type references and parameter descriptions
- Updated cmdlet parameter names (e.g.,
-BackupInstanceNameto-Namein Update-AzDataProtectionBackupInstance) - Removed deprecated
-IdentityTypeparameter from ResourceGuard cmdlets - Added new parameter sets and identity objects for various operations
Reviewed changes
Copilot reviewed 144 out of 144 changed files in this pull request and generated 14 comments.
Show a summary per file
| File | Description |
|---|---|
| src/DataProtection/DataProtection.Autorest/README.md | Removed AutoRest v3 extension directive, updated variant removal patterns, added new directives |
| src/DataProtection/DataProtection/help/*.md | Regenerated help documentation with updated type references and corrected spellings |
| src/DataProtection/DataProtection.Autorest/custom/**/*.ps1 | Updated model namespace references throughout custom cmdlets |
| src/DataProtection/DataProtection.Autorest/custom/Models/*.cs | Updated namespace from Api20250901 to root Models namespace |
| src/DataProtection/DataProtection/Az.DataProtection.psd1 | Updated module manifest metadata |
| src/DataProtection/DataProtection.sln | Updated project GUID |
| src/DataProtection/DataProtection.Autorest/Properties/AssemblyInfo.cs | Version bump from 2.8.0 to 2.9.0 |
src/DataProtection/DataProtection/help/Start-AzDataProtectionBackupInstanceRestore.md
Outdated
Show resolved
Hide resolved
src/DataProtection/DataProtection/help/New-AzDataProtectionPolicyTriggerScheduleClientObject.md
Outdated
Show resolved
Hide resolved
src/DataProtection/DataProtection/help/New-AzDataProtectionBackupInstance.md
Outdated
Show resolved
Hide resolved
src/DataProtection/DataProtection/help/Find-AzDataProtectionRestorableTimeRange.md
Outdated
Show resolved
Hide resolved
src/DataProtection/DataProtection/help/Find-AzDataProtectionRestorableTimeRange.md
Outdated
Show resolved
Hide resolved
src/DataProtection/DataProtection/help/Start-AzDataProtectionBackupInstanceRestore.md
Outdated
Show resolved
Hide resolved
src/DataProtection/DataProtection/help/New-AzDataProtectionBackupPolicy.md
Outdated
Show resolved
Hide resolved
src/DataProtection/DataProtection/help/New-AzDataProtectionBackupPolicy.md
Outdated
Show resolved
Hide resolved
src/DataProtection/DataProtection/help/New-AzDataProtectionBackupInstance.md
Outdated
Show resolved
Hide resolved
src/DataProtection/DataProtection/help/New-AzDataProtectionBackupInstance.md
Outdated
Show resolved
Hide resolved
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
To the author of the pull request, |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
...ion.Autorest/custom/Cmdlets/Platform/Restore/Start-AzDataProtectionBackupInstanceRestore.ps1
Show resolved
Hide resolved
...on/DataProtection.Autorest/custom/Cmdlets/Platform/Vault/New-AzDataProtectionBackupVault.ps1
Show resolved
Hide resolved
...DataProtection.Autorest/custom/Cmdlets/Platform/Vault/Undo-AzDataProtectionVaultDeletion.ps1
Show resolved
Hide resolved
...DataProtection.Autorest/custom/Cmdlets/Platform/Vault/Undo-AzDataProtectionVaultDeletion.ps1
Show resolved
Hide resolved
...DataProtection.Autorest/custom/Cmdlets/Platform/Vault/Update-AzDataProtectionBackupVault.ps1
Show resolved
Hide resolved
src/DataProtection/DataProtection.Autorest/docs/Update-AzDataProtectionBackupVault.md
Show resolved
Hide resolved
src/DataProtection/DataProtection/help/Suspend-AzDataProtectionBackupInstanceBackup.md
Outdated
Show resolved
Hide resolved
src/DataProtection/DataProtection/help/Undo-AzDataProtectionVaultDeletion.md
Show resolved
Hide resolved
src/DataProtection/DataProtection/help/Update-AzDataProtectionBackupInstance.md
Outdated
Show resolved
Hide resolved
rerecorded failed tests
| The fourth command initializes the prefix array for each container. | ||
| PrefixMatch is a hashtable where each key is the conatiner name being restored and the value is a list of string prfixes for container names for Item level recovery. | ||
| PrefixMatch is a hashtable where each key is the container name being restored and the value is a list of string prfixes for container names for Item level recovery. | ||
| The fifth command initializes the target storage account Id. |
There was a problem hiding this comment.
There is a spelling error in the description: "prfixes" should be "prefixes" (user-facing help text).
| ## Upcoming Release | ||
| * Improved user experience and consistency. This may introduce breaking changes. Please refer to [here](https://go.microsoft.com/fwlink/?linkid=2340249). | ||
|
|
||
| * Preannounced breaking changes. Please refer to https://go.microsoft.com/fwlink/?linkid=2333229 |
There was a problem hiding this comment.
The Upcoming Release entry is very generic ("Improved user experience and consistency") and doesn’t tell users what changed in Az.DataProtection. Since this PR migrates the module and introduces breaking changes, the changelog should summarize the concrete user-visible impacts (e.g., cmdlet/parameter changes) and avoid vague link text like "here".
| $AksRestoreVariables = @{ | ||
| SubscriptionId = "2c6832bf-90ef-457a-a663-9aeae88a7f80" | ||
| ResourceGroupName = "tiering-test" | ||
| VaultName = "aks-tiering-test" #"demobackupvault" | ||
| NewPolicyName = "" #"pstest-aks-policy" | ||
| PolicyName = "test01" | ||
| DataSourceLocation = "eastasia" | ||
| SourceClusterId = "/subscriptions/2c6832bf-90ef-457a-a663-9aeae88a7f80/resourceGroups/tiering-test/providers/Microsoft.ContainerService/managedClusters/aks-test-priyansh" | ||
| SnapshotResourceGroupId = "/subscriptions/2c6832bf-90ef-457a-a663-9aeae88a7f80/resourceGroups/tiering-test" | ||
| FriendlyName = "aks-test-priyansh\newBI" | ||
| ClusterName = "aks-test-priyansh" | ||
| # just does backup and restore, any cluster would work with healthy state | ||
| SubscriptionId = "38304e13-357e-405e-9e9a-220351dcce8c" #"2c6832bf-90ef-457a-a663-9aeae88a7f80" | ||
| ResourceGroupName = "payalsinghal" #"priyansh-rg" | ||
| VaultName = "payaUAMIECY" #"priyansh-vault" | ||
| NewPolicyName = "pstest-aks-policy" | ||
| PolicyName = "uami01" #"choudharypr-gc-policy-1" | ||
| DataSourceLocation = "eastus2euap" #"eastasia" | ||
| SourceClusterId = "/subscriptions/38304e13-357e-405e-9e9a-220351dcce8c/resourceGroups/payalsinghal/providers/microsoft.containerservice/managedClusters/payaUAMIECY" #"/subscriptions/2c6832bf-90ef-457a-a663-9aeae88a7f80/resourceGroups/priyansh-rg/providers/Microsoft.ContainerService/managedClusters/priyansh-scaletest" | ||
| SnapshotResourceGroupId = "/subscriptions/38304e13-357e-405e-9e9a-220351dcce8c/resourceGroups/payalsinghal" #"/subscriptions/2c6832bf-90ef-457a-a663-9aeae88a7f80/resourceGroups/priyansh-rg" | ||
| FriendlyName = "payaUAMIECY\uami01ECY" #"priyansh-scaletest\small-sizes" | ||
| ClusterName = "payaUAMIECY" |
There was a problem hiding this comment.
The updated AKS restore test variables are hard-coded to a specific subscription/resource group/vault/cluster (and the previous values are left commented out). This makes the test environment brittle and likely to fail in CI/other dev environments; please move these values to the normal test environment configuration (or keep placeholders) rather than embedding specific live resource IDs in the repo.
|
|
||
| [Parameter(ParameterSetName="TriggerExpanded", Mandatory, HelpMessage='Type of the source data store')] | ||
| [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Support.SourceDataStoreType] | ||
| [System.String] |
There was a problem hiding this comment.
SourceDataStoreType is typed as System.String, but the generated module includes Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Support.SourceDataStoreType with an ArgumentCompleter. Keeping the Support type here would preserve validation/tab-completion and match the underlying generated cmdlet contract.
| [System.String] | |
| [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Support.SourceDataStoreType] |
| ### [Test-AzDataProtectionBackupInstanceUpdate](Test-AzDataProtectionBackupInstanceUpdate.md) | ||
| Validate whether update for backup instance will be successful or not | ||
| Validate whether validate for backup instance will be successful or not | ||
|
|
There was a problem hiding this comment.
The module index entry description repeats the same grammatical error as the cmdlet help ("Validate whether validate for backup instance..."). Since this is user-facing, please fix the wording to be clear and consistent with the cmdlet synopsis.
| ### -UseSystemAssignedIdentity | ||
| Use system assigned identity | ||
|
|
||
| ```yaml | ||
| Type: System.Nullable`1[[System.Boolean, System.Private.CoreLib, Version=9.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]] | ||
| Type: System.Nullable`1[[System.Boolean, System.Private.CoreLib, Version=10.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]] | ||
| Parameter Sets: (All) |
There was a problem hiding this comment.
The generated docs now include an assembly-qualified type with System.Private.CoreLib, Version=10.0.0.0 for -UseSystemAssignedIdentity. This is confusing/noisy for users and suggests help generation picked up a runtime-specific type name; please regenerate/help-normalize types to stable PowerShell-friendly forms (e.g., System.Nullable[System.Boolean] or System.Boolean).
| "Az.DataProtection","Update-AzDataProtectionBackupVault","6","3","Unassigned_Parameter","5013","1","Update-AzDataProtectionBackupVault -EnableSystemAssignedIdentity must be assigned with a value.","-EnableSystemAssignedIdentity","Assign value for the parameter -EnableSystemAssignedIdentity." | ||
| "Az.DataProtection","Update-AzDataProtectionBackupVault","6","3","Unassigned_Parameter","5013","1","Update-AzDataProtectionBackupVault -EnableSystemAssignedIdentity must be assigned with a value.","-EnableSystemAssignedIdentity","Assign value for the parameter -EnableSystemAssignedIdentity." |
There was a problem hiding this comment.
ExampleIssues.csv contains two identical exception entries for Update-AzDataProtectionBackupVault (rows 5 and 6). This duplication makes it harder to track/maintain suppressions and may cause confusion when updating/removing exceptions; please remove the duplicate row (or differentiate them if they are meant to cover distinct cases).
| @@ -63,29 +63,28 @@ | |||
| ${SoftDeleteRetentionDurationInDay}, | |||
|
|
|||
| [Parameter(Mandatory=$false, HelpMessage='Soft delete state of the vault. Allowed values are Off, On, AlwaysOn')] | |||
| [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Support.SoftDeleteState] | |||
| [System.String] | |||
| [ValidateSet('Off','On', 'AlwaysOn')] | |||
| ${SoftDeleteState}, | |||
|
|
|||
| [Parameter(HelpMessage='Resource tags.')] | |||
| [System.Collections.Hashtable] | |||
| ${Tag}, | |||
|
|
|||
| [Parameter(Mandatory=$false, HelpMessage='Gets or sets the user assigned identities.')] | |||
| [Alias('UserAssignedIdentity', 'AssignUserIdentity')] | |||
| [System.Collections.Hashtable] | |||
| ${IdentityUserAssignedIdentity}, | |||
| [Parameter(HelpMessage='The array of user assigned identities associated with the resource. The elements in array will be ARM resource ids in the form: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}."')] | |||
| [System.String[]] | |||
| ${UserAssignedIdentity}, | |||
|
|
|||
| [Parameter(Mandatory=$false, HelpMessage='Enable CMK encryption state for a Backup Vault.')] | |||
| [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Support.EncryptionState] | |||
| [System.String] | |||
| ${CmkEncryptionState}, | |||
|
|
|||
| [Parameter(Mandatory=$false, HelpMessage='Enable infrastructure encryption with CMK on this vault. Infrastructure encryption must be configured only when creating the vault.')] | |||
| [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Support.InfrastructureEncryptionState] | |||
| [System.String] | |||
| ${CmkInfrastructureEncryption}, | |||
|
|
|||
| [Parameter(Mandatory=$false, HelpMessage='The identity type to be used for CMK encryption - SystemAssigned or UserAssigned Identity.')] | |||
| [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Support.IdentityType] | |||
| [System.String] | |||
| ${CmkIdentityType}, | |||
There was a problem hiding this comment.
Several parameters were changed from DataProtection.Support types to plain strings (e.g., AzureMonitorAlertsForAllJobFailure, ImmutabilityState, CrossRegionRestoreState, SoftDeleteState, and CMK-related parameters). The Support types still exist in the generated code and provide built-in argument completers/type conversion; using plain strings here weakens validation and tab-completion, especially for CMK parameters which currently have no ValidateSet.
| @@ -165,13 +159,13 @@ | |||
| return | |||
| } | |||
There was a problem hiding this comment.
The cmdlet previously defaulted identity to SystemAssigned when the identity parameter was not provided, but the current wrapper does not set any default for EnableSystemAssignedIdentity. This changes the default behavior of New-AzDataProtectionBackupVault (vaults may now be created without an identity), which is a breaking change; consider preserving the previous default (set EnableSystemAssignedIdentity when absent) or explicitly document this behavior change in help/changelog.
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
Description
Preannouncement PR: #29125
Mandatory Checklist
Please choose the target release of Azure PowerShell. (⚠️ Target release is a different concept from API readiness. Please click below links for details.)
Check this box to confirm: I have read the Submitting Changes section of
CONTRIBUTING.mdand reviewed the following information:ChangeLog.mdfile(s) appropriatelysrc/{{SERVICE}}/{{SERVICE}}/ChangeLog.md.## Upcoming Releaseheader in the past tense.ChangeLog.mdif no new release is required, such as fixing test case only.