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 48 commits intoAzure:autorest-v4-breakingchangefrom
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 48 commits intoAzure:autorest-v4-breakingchangefrom
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

Comment thread src/DataProtection/DataProtection/help/New-AzDataProtectionBackupInstance.md Outdated
Comment thread src/DataProtection/DataProtection/help/New-AzDataProtectionBackupPolicy.md Outdated
Comment thread src/DataProtection/DataProtection/help/New-AzDataProtectionBackupPolicy.md Outdated
Comment thread src/DataProtection/DataProtection/help/New-AzDataProtectionBackupInstance.md Outdated
Comment thread src/DataProtection/DataProtection/help/New-AzDataProtectionBackupInstance.md Outdated
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 May 5, 2026 03:42
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 171 out of 172 changed files in this pull request and generated 10 comments.

Comment on lines +1 to +4
@{
GUID = '18e8a0b0-ef6f-49db-8024-676d2f12e3d8'
RootModule = './Az.DnsResolver.psm1'
ModuleVersion = '0.2.9'
Comment on lines +73 to +75
$UAMI = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedIdentity/userAssignedIdentities/userAssignedIdentityName"

$vault = Update-AzDataProtectionBackupVault -AssignUserIdentity $UAMI -SubscriptionId "00000000-0000-0000-0000-000000000000" -VaultName "vaultName" -ResourceGroupName "resourceGroupName" -IdentityType 'SystemAssigned,UserAssigned'
$vault = Update-AzDataProtectionBackupVault -EnableSystemAssignedIdentity -UserAssignedIdentity $UAMI -SubscriptionId "00000000-0000-0000-0000-000000000000" -VaultName "vaultName" -ResourceGroupName "resourceGroupName"

[Parameter(ParameterSetName="TriggerExpanded", Mandatory, HelpMessage='Type of the source data store')]
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Support.SourceDataStoreType]
[System.String]
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."
"Az.DataProtection","Start-AzDataProtectionBackupInstanceRestore","9","4","ParameterNameAndValue\Measure-ParameterNameAndValue","5200","1","Exception calling 'FindAll' with '2' argument(s): 'Cannot index into a null array.'","'teststorageaccountRG'","Unexpected Error. Please check [Trouble Shotting for Unexpected Errors in Example Issues](***/blob/main/documentation/Debugging-StaticAnalysis-Errors.md#Troubleshotting-Example-Issues) for more details." No newline at end of file
"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."
"Az.DataProtection","Start-AzDataProtectionBackupInstanceRestore","9","4","ParameterNameAndValue\Measure-ParameterNameAndValue","5200","1","Exception calling 'FindAll' with '2' argument(s): 'Cannot index into a null array.'","'teststorageaccountRG'","Unexpected Error. Please check [Trouble Shotting for Unexpected Errors in Example Issues](***/blob/main/documentation/Debugging-StaticAnalysis-Errors.md#Troubleshotting-Example-Issues) for more details."
Comment on lines 10 to +11
## SYNOPSIS
Validate whether update for backup instance will be successful or not
Validate whether validate for backup instance will be successful or not
Comment on lines 184 to 195
$createVaultParams.Add("SubscriptionId", $SubscriptionId)
}

# Set identity type (default to SystemAssigned if not specified)
if($PSBoundParameters.ContainsKey("IdentityType"))
# Set identity - default to SystemAssigned if not specified
if($PSBoundParameters.ContainsKey("EnableSystemAssignedIdentity"))
{
$createVaultParams.Add("IdentityType", $IdentityType)
$createVaultParams.Add("EnableSystemAssignedIdentity", $EnableSystemAssignedIdentity)
}
else
{
$createVaultParams.Add("IdentityType", "SystemAssigned")
$createVaultParams.Add("EnableSystemAssignedIdentity", $true)
}
Comment on lines +187 to 195
# Set identity - default to SystemAssigned if not specified
if($PSBoundParameters.ContainsKey("EnableSystemAssignedIdentity"))
{
$createVaultParams.Add("IdentityType", $IdentityType)
$createVaultParams.Add("EnableSystemAssignedIdentity", $EnableSystemAssignedIdentity)
}
else
{
$createVaultParams.Add("IdentityType", "SystemAssigned")
$createVaultParams.Add("EnableSystemAssignedIdentity", $true)
}
Comment on lines +3 to +4
"Az.DataProtection","Edit-AzDataProtectionPolicyRetentionRuleClientObject","Edit-AzDataProtectionPolicyRetentionRuleClientObject","0","3000","The type of property 'PolicyRule' of type 'Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20250901.IBackupPolicy' has changed from 'Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.IBasePolicyRule' to 'System.Collections.Generic.List`1[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.IBasePolicyRule]'.","Change the type of property 'PolicyRule' back to 'Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.IBasePolicyRule'."
"Az.DataProtection","Edit-AzDataProtectionPolicyRetentionRuleClientObject","Edit-AzDataProtectionPolicyRetentionRuleClientObject","0","3000","The type of property 'PolicyRule' of type 'Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20250901.IBackupPolicy' has changed from 'Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.IBasePolicyRule' to 'System.Collections.Generic.List`1[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.IBasePolicyRule]'.","Change the type of property 'PolicyRule' back to 'Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.IBasePolicyRule'."
Comment on lines 121 to +136
@@ -132,10 +131,9 @@ Name Location Type IdentityType
vaultName southeastasia Microsoft.DataProtection/backupVaults SystemAssigned, UserAssigned
```

First, create a hashtable for the User Assigned Managed Identity (UAMI) object.
This object maps the UAMI resource ID to a new instance of UserAssignedIdentity.
First, define the User Assigned Managed Identity (UAMI) ARM resource ID.
Next, use the Update-AzDataProtectionBackupVault cmdlet to assign the UAMI to the backup vault while keeping the System Assigned Managed Identity.
The -IdentityType parameter specifies that both SystemAssigned and UserAssigned identities are used.
The -EnableSystemAssignedIdentity switch enables the system-assigned identity, and the -UserAssignedIdentity parameter specifies the user-assigned identity to associate with the vault.
@khang-11 khang-11 changed the base branch from main to autorest-v4-breakingchange May 6, 2026 00:51
@JunKai-v
Copy link
Copy Markdown
Contributor Author

JunKai-v commented May 6, 2026

/azp run

@azure-pipelines
Copy link
Copy Markdown
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.