[PS] Migrate DataProtection module to autorest v4#29023
[PS] Migrate DataProtection module to autorest v4#29023JunKai-v wants to merge 11 commits intoAzure:mainfrom
Conversation
| Thanks for your contribution! The pull request validation has started. Please revisit this comment for updated status. |
|
@microsoft-github-policy-service agree company="Microsoft" |
| ```powershell | ||
| {{ Add code here }} |
There was a problem hiding this comment.
Please resolve these placeholder examples
There was a problem hiding this comment.
Pull request overview
This pull request migrates the DataProtection module from AutoRest v3 to AutoRest v4. The migration includes regenerating help documentation files, updating module manifests, adding new cmdlets, updating tests, and modifying examples to align with the new API version.
Key Changes:
- Added 3 new cmdlets:
Update-AzDataProtectionBackupPolicy,Update-AzDataProtectionResourceGuardMapping, andUnlock-AzDataProtectionDppResourceGuardProxyDelete - Updated help documentation across ~80 files to reflect API changes (type namespace changes from
Api20250201to base types) - Updated module manifest with new required Az.Accounts version (5.3.1) and new exported functions
- Modified parameter types from enum types to strings for better flexibility
- Updated examples to use simplified syntax for user-assigned identities
Reviewed changes
Copilot reviewed 152 out of 152 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| ChangeLog.md | Added entry for breaking changes with link to migration guide |
| Az.DataProtection.psd1 | Updated module version dependencies and exported functions |
| Help/*.md (80+ files) | Updated documentation with API v4 changes, parameter type updates, and namespace changes |
| Test files | Added placeholder tests for new cmdlets; updated existing test with namespace change |
| Example files | Updated examples with simplified UAMI syntax |
| Solution files | Updated project GUIDs for regenerated project |
| .gitignore | Removed unnecessary ignore entries |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
|
||
| The first, second commands fetch the instance and recovery point for the instance. | ||
| The third and fourth command initializes the target container id and target storage account ARM id. | ||
| The third and fourthcommand initializes the target container id and target storage account ARM id. |
There was a problem hiding this comment.
Spelling error: "fourthcommand" should be "fourth command"
| The last command triggers the restore for AzureDatabaseForPGFlexServer. | ||
|
|
||
| ### Example 10: Trigger vaulted backup containers ItemLevelRestore with PrefixMatch for Azureblob. | ||
| ### Example 10: Trigger vaulted backup conatiners ItemLevelRestore with PrefixMatch for Azureblob. |
There was a problem hiding this comment.
Spelling error: "conatiners" should be "containers"
| ``` | ||
|
|
||
| This command creates an hourly schedule for Azure Backup Rule. | ||
| This command creates an hourly scheudle for Azure Backup Rule. |
There was a problem hiding this comment.
Spelling error: "scheudle" should be "schedule"
| The sixth command assigns the necessary permissions for configure backup. | ||
|
|
||
| The seventh and eight command initializes custom tags and configure backup finally by creating a backup instance. | ||
| The sevnth and eight command initializes custom tags and configure backup finally by creating a backup instance. |
There was a problem hiding this comment.
Spelling error: "sevnth" should be "seventh"
| This command adds a weekly tag to given backup policy | ||
|
|
||
| ### Example 2: Remove Weekly tag from Backup Policy | ||
| ### Example 2: Remove Weeky tag from Backup Policy |
There was a problem hiding this comment.
Spelling error: "Weeky" should be "Weekly"
| ``` | ||
|
|
||
| First command gets a specific vault by given vault name, subsequent three commands fetch the specified properties of encryption settings. | ||
| First command gets a specific vault by given vault name, subsequent three commands fetch the specity properites of encryption settings. |
There was a problem hiding this comment.
Spelling error: "specity" should be "specify"
|
|
||
| The first command is used to fetch the resource guard to be updated. | ||
| The second and third command is used to fetch the critical operations user want to update. | ||
| The second and third command is used to fecth the critical operations user want to update. |
There was a problem hiding this comment.
Spelling error: "fecth" should be "fetch"
| Fetch the backup instance. | ||
| Fetch valid time ranges for Backup Instance $instance[0]. | ||
| Display RestorableTimeRange, note that this can be multiple discrete ranges. | ||
| Dispaly RestorableTimeRange, note that this can be multiple dicrete ranges. |
There was a problem hiding this comment.
Spelling error: "Dispaly" should be "Display"
| Fetch the backup instance. | ||
| Fetch valid time ranges for Backup Instance $instance[0]. | ||
| Display RestorableTimeRange, note that this can be multiple discrete ranges. | ||
| Dispaly RestorableTimeRange, note that this can be multiple dicrete ranges. |
There was a problem hiding this comment.
Spelling error: "dicrete" should be "discrete"
| ``` | ||
|
|
||
| First command gets a specific vault by given vault name, subsequent three commands fetch the specified properties of encryption settings. | ||
| First command gets a specific vault by given vault name, subsequent three commands fetch the specity properites of encryption settings. |
There was a problem hiding this comment.
Spelling error: "properites" should be "properties"
|
To the author of the pull request, |
3c0a1a8 to
8c9f55e
Compare
|
|
||
| This command is used to change CmkIdentityType from SystemAssigned to UserAssigned. | ||
| CmkIdentityId is a required parameter. | ||
| This command is used to change CmkIdentityType from SystemAssigned to UserAssgined. |
There was a problem hiding this comment.
Typo: "UserAssgined" should be "UserAssigned"
| This command is used to change CmkIdentityType from SystemAssigned to UserAssigned. | ||
| CmkIdentityId is a required parameter. | ||
| This command is used to change CmkIdentityType from SystemAssigned to UserAssgined. | ||
| CmkIdenityId is a required parameter. |
There was a problem hiding this comment.
Typo: "CmkIdenityId" should be "CmkIdentityId"
|
|
||
| The first command is used to fetch the resource guard to be updated. | ||
| The second and third command is used to fetch the critical operations user want to update. | ||
| The second and third command is used to fecth the critical operations user want to update. |
There was a problem hiding this comment.
Typo: "fecth" should be "fetch"
| The last command triggers the restore for AzureDatabaseForPGFlexServer. | ||
|
|
||
| ### Example 10: Trigger vaulted backup containers ItemLevelRestore with PrefixMatch for Azureblob. | ||
| ### Example 10: Trigger vaulted backup conatiners ItemLevelRestore with PrefixMatch for Azureblob. |
There was a problem hiding this comment.
Typo: "conatiners" should be "containers"
| The seventh command updates the policy object with custom schedule. | ||
| The eighth, ninth, tenth commands update the Monthly retention rule with custom lifecycles. | ||
| The eleventh, twelfth commands create a tag criteria for Monthly policy. | ||
| The eleventh, twelth commands create a tag criteria for Monthly policy. |
There was a problem hiding this comment.
Typo: "twelth" should be "twelfth"
| - Additional information about change #1 | ||
| --> | ||
| ## Upcoming Release | ||
| * Improved user experience and consistency. This may introduce breaking changes. Please refer to [here](https://go.microsoft.com/fwlink/?linkid=2340249). |
There was a problem hiding this comment.
The ChangeLog entry should be written in the past tense to describe what was changed, not as a generic statement about user experience. Consider a more specific entry like: "Migrated module to AutoRest v4 for improved consistency. This introduces breaking changes documented at [link]."
| This command adds a weekly tag to given backup policy | ||
|
|
||
| ### Example 2: Remove Weekly tag from Backup Policy | ||
| ### Example 2: Remove Weeky tag from Backup Policy |
There was a problem hiding this comment.
Typo: "Weeky" should be "Weekly"
| The sixth command assigns the necessary permissions for configure backup. | ||
|
|
||
| The seventh and eight command initializes custom tags and configure backup finally by creating a backup instance. | ||
| The sevnth and eight command initializes custom tags and configure backup finally by creating a backup instance. |
There was a problem hiding this comment.
Typo: "sevnth" should be "seventh"
| Start-Sleep -Seconds 10 | ||
| } | ||
| $backupinstanceCreate = New-AzDataProtectionBackupInstance -ResourceGroupName "resourceGroupName" -VaultName "vaultName" -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -BackupInstance $backupInstanceClientObject | ||
| $backupnstanceCreate = New-AzDataProtectionBackupInstance -ResourceGroupName "resourceGroupName" -VaultName "vaultName" -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -BackupInstance $backupInstanceClientObject |
There was a problem hiding this comment.
Typo: "backupnstanceCreate" should be "backupInstanceCreate"
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
/azp run |
|
Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command. |
|
replace by #29122 |
Description
Preannouncement PR: #29117
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.