[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
Open
[PS] Migrate DataProtection module to autorest v4 after <Added support for DPP vault soft delete feature>#29122JunKai-v wants to merge 48 commits intoAzure:autorest-v4-breakingchangefrom
JunKai-v wants to merge 48 commits intoAzure:autorest-v4-breakingchangefrom
Conversation
| Thanks for your contribution! The pull request validation has started. Please revisit this comment for updated status. |
6 tasks
Contributor
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 |
Contributor
Author
|
/azp run |
Contributor
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
To the author of the pull request, |
Contributor
Author
|
/azp run |
Contributor
|
Azure Pipelines successfully started running 3 pipeline(s). |
6 tasks
Contributor
Author
|
/azp run |
Contributor
|
Azure Pipelines successfully started running 3 pipeline(s). |
…kup (Azure#29408) Co-authored-by: Selasie Mortey <smortey@microsoft.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ke idempotent (Azure#29473) Co-authored-by: Jonathan Ruttle <jruttle@microsoft.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Yabo Hu <yabhu@microsoft.com>
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. | |||
Contributor
Author
|
/azp run |
Contributor
|
Azure Pipelines successfully started running 3 pipeline(s). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.