Skip to content

[PS] Migrate DataProtection module to autorest v4 after <Added support for DPP vault soft delete feature>#29122

Open
JunKai-v wants to merge 15 commits intoAzure:mainfrom
JunKai-v:dp-v4-new
Open

[PS] Migrate DataProtection module to autorest v4 after <Added support for DPP vault soft delete feature>#29122
JunKai-v wants to merge 15 commits intoAzure:mainfrom
JunKai-v:dp-v4-new

Conversation

@JunKai-v
Copy link
Copy Markdown
Contributor

@JunKai-v JunKai-v commented Jan 30, 2026

Description

Preannouncement PR: #29125

Mandatory Checklist

  • SHOULD update ChangeLog.md file(s) appropriately
    • Update src/{{SERVICE}}/{{SERVICE}}/ChangeLog.md.
      • A snippet outlining the change(s) made in the PR should be written under the ## Upcoming Release header in the past tense.
    • Should not change ChangeLog.md if no new release is required, such as fixing test case only.
  • SHOULD regenerate markdown help files if there is cmdlet API change. Instruction
  • SHOULD have proper test coverage for changes in pull request.
  • SHOULD NOT adjust version of module manually in pull request

Copilot AI review requested due to automatic review settings January 30, 2026 11:45
@azure-client-tools-bot-prd
Copy link
Copy Markdown

Thanks for your contribution! The pull request validation has started. Please revisit this comment for updated status.

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 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-extension directive in README.md
  • Updated model namespaces from Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20250901 to Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models
  • Changed identity-related parameters in vault cmdlets (replaced -IdentityType and -IdentityUserAssignedIdentity with -EnableSystemAssignedIdentity and -UserAssignedIdentity)
  • Regenerated help documentation with updated type references and parameter descriptions
  • Updated cmdlet parameter names (e.g., -BackupInstanceName to -Name in Update-AzDataProtectionBackupInstance)
  • Removed deprecated -IdentityType parameter 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

Copilot AI review requested due to automatic review settings February 3, 2026 00:37
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

Copilot reviewed 146 out of 146 changed files in this pull request and generated no new comments.

@JunKai-v
Copy link
Copy Markdown
Contributor Author

JunKai-v commented Feb 3, 2026

/azp run

@azure-pipelines
Copy link
Copy Markdown
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

@JunKai-v JunKai-v added Contains Breaking Change This PR contains breaking change customer-reported autorest v4 migration pr migrating module from generated by autorest.powershell v3 to v4 labels Feb 3, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Feb 3, 2026

To the author of the pull request,
This PR was labeled "Contains Breaking Change" because breaking changes have been detected by the static analysis pipeline.

  • According to our policy, breaking changes can only take place during major release and they must be preannounced.
  • Please follow our guide on the detailed steps.
  • Required: Please fill in the task below to facilitate our contact,you will receive notifications related to breaking changes.

@JunKai-v
Copy link
Copy Markdown
Contributor Author

JunKai-v commented Feb 3, 2026

/azp run

@azure-pipelines
Copy link
Copy Markdown
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

@JunKai-v
Copy link
Copy Markdown
Contributor Author

JunKai-v commented Feb 4, 2026

/azp run

@azure-pipelines
Copy link
Copy Markdown
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

Copilot AI review requested due to automatic review settings February 4, 2026 02:02
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

Copilot reviewed 156 out of 156 changed files in this pull request and generated no new comments.

Copilot AI review requested due to automatic review settings February 5, 2026 00:45

This comment was marked as spam.

@JunKai-v JunKai-v marked this pull request as ready for review March 26, 2026 04:07
@JunKai-v JunKai-v requested review from VeryEarly and Copilot March 26, 2026 04:07

This comment was marked as spam.

Copilot AI review requested due to automatic review settings March 27, 2026 05:21
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

Copilot reviewed 167 out of 176 changed files in this pull request and generated 9 comments.

Comment on lines 229 to 231
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.
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

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

There is a spelling error in the description: "prfixes" should be "prefixes" (user-facing help text).

Copilot uses AI. Check for mistakes.
Comment on lines 20 to 23
## 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
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

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

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

Copilot uses AI. Check for mistakes.
Comment on lines 170 to +181
$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"
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.

[Parameter(ParameterSetName="TriggerExpanded", Mandatory, HelpMessage='Type of the source data store')]
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Support.SourceDataStoreType]
[System.String]
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

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

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.

Suggested change
[System.String]
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Support.SourceDataStoreType]

Copilot uses AI. Check for mistakes.
Comment on lines 158 to 160
### [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

Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
Comment on lines 237 to 242
### -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)
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

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

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

Copilot uses AI. Check for mistakes.
Comment on lines +5 to +6
"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."
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

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

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

Copilot uses AI. Check for mistakes.
Comment on lines 41 to 88
@@ -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},
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
Comment on lines 149 to 160
@@ -165,13 +159,13 @@
return
}
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
@JunKai-v
Copy link
Copy Markdown
Contributor Author

JunKai-v commented Apr 7, 2026

/azp run

@azure-pipelines
Copy link
Copy Markdown
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

@JunKai-v JunKai-v added this to the Az 16.0.0 (06/02/2026) milestone Apr 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autorest v4 migration pr migrating module from generated by autorest.powershell v3 to v4 Contains Breaking Change This PR contains breaking change customer-reported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants