Add Azure Elastic SAN support for backup and restore operations#29738
Draft
priyansh17 wants to merge 1 commit into
Draft
Add Azure Elastic SAN support for backup and restore operations#29738priyansh17 wants to merge 1 commit into
priyansh17 wants to merge 1 commit into
Conversation
- Introduced `AzureElasticSAN` datasource type in `DatasourceTypesInfo.json`. - Updated documentation for `Initialize-AzDataProtectionRestoreRequest` to include examples for Azure Elastic SAN. - Enhanced `New-AzDataProtectionBackupConfigurationClientObject` with `-ResourceSelector` parameter for single volume selection. - Added `ResourceIdentifier` and `ResourceNameOverride` parameters to `New-AzDataProtectionRestoreConfigurationClientObject` for restoring volumes. - Implemented permission management for Azure Elastic SAN in `Set-AzDataProtectionMSIPermission`. - Created manifest file for Azure Elastic SAN with required permissions and policy settings. - Added tests for backup and restore configurations specific to Azure Elastic SAN.
| Thanks for your contribution! The pull request validation has started. Please revisit this comment for updated status. |
Contributor
|
Thank you for your contribution @priyansh17! We will review the pull request and get back to you soon. |
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR adds Azure Elastic SAN (AzureElasticSAN) data source support to the DataProtection PowerShell module, including backup/restore configuration, restore request wiring, permissions guidance, and supporting manifests/models.
Changes:
- Added AzureElasticSAN to data source enums/manifests and documented cmdlet usage for backup/restore and MSI permissions.
- Implemented AzureElasticSAN-specific parameter handling in backup/restore configuration cmdlets and updated restore request initialization logic.
- Introduced Pester tests and hand-added (“grafted”) generated models needed for preview API compatibility.
Reviewed changes
Copilot reviewed 13 out of 18 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/DataProtection/DataProtection/ChangeLog.md | Announces upcoming AzureElasticSAN backup/restore support and new parameters. |
| src/DataProtection/DataProtection.Autorest/test/ElasticSanBackupRestoreConfiguration.Tests.ps1 | Adds Pester coverage for AzureElasticSAN backup/restore configuration behavior. |
| src/DataProtection/DataProtection.Autorest/docs/Set-AzDataProtectionMSIPermission.md | Documents MSI permission grants for AzureElasticSAN backup/restore scenarios. |
| src/DataProtection/DataProtection.Autorest/docs/New-AzDataProtectionRestoreConfigurationClientObject.md | Documents AzureElasticSAN restore configuration parameters and examples. |
| src/DataProtection/DataProtection.Autorest/docs/New-AzDataProtectionBackupConfigurationClientObject.md | Documents AzureElasticSAN backup configuration parameters and examples. |
| src/DataProtection/DataProtection.Autorest/docs/Initialize-AzDataProtectionRestoreRequest.md | Adds an AzureElasticSAN restore request example using RestoreConfiguration. |
| src/DataProtection/DataProtection.Autorest/custom/manifests/DatasourceTypesInfo.json | Maps AzureElasticSAN client type to its service resource type. |
| src/DataProtection/DataProtection.Autorest/custom/manifests/AzureElasticSAN.json | Adds datasource manifest describing permissions and policy defaults for AzureElasticSAN. |
| src/DataProtection/DataProtection.Autorest/custom/Enums/Enums.cs | Adds AzureElasticSAN to the DatasourceTypes enum. |
| src/DataProtection/DataProtection.Autorest/custom/Cmdlets/Platform/Restore/New-AzDataProtectionRestoreConfigurationClientObject.ps1 | Adds AzureElasticSAN restore configuration parameters and object construction. |
| src/DataProtection/DataProtection.Autorest/custom/Cmdlets/Platform/Restore/Initialize-AzDataProtectionRestoreRequest.ps1 | Treats AzureElasticSAN similarly to AKS for restore configuration–driven paths. |
| src/DataProtection/DataProtection.Autorest/custom/Cmdlets/Platform/BackupInstance/New-AzDataProtectionBackupConfigurationClientObject.ps1 | Adds AzureElasticSAN backup configuration parameter validation and object construction. |
| src/DataProtection/DataProtection.Autorest/custom/Cmdlets/Platform/BackupInstance/Initialize-AzDataProtectionBackupInstance.ps1 | Updates help text to include AzureElasticSAN. |
| generated/DataProtection/DataProtection.Autorest/generated/api/Models/ResourceListSelectionCriteria.cs | Adds a hand-written model required for eSAN restore criteria serialization. |
| generated/DataProtection/DataProtection.Autorest/generated/api/Models/ItemLevelRestoreCriteria.json.cs | Adds discriminator support for GenericRestoreDatasourceCriteria. |
| generated/DataProtection/DataProtection.Autorest/generated/api/Models/GenericRestoreDatasourceCriteria.cs | Adds a hand-written restore criteria model for eSAN. |
| generated/DataProtection/DataProtection.Autorest/generated/api/Models/GenericBackupDatasourceParameters.cs | Adds a hand-written backup parameters model for eSAN. |
| generated/DataProtection/DataProtection.Autorest/generated/api/Models/BackupDatasourceParameters.json.cs | Adds discriminator support for GenericBackupDatasourceParameters. |
Comment on lines
+8
to
+11
| while(-not $mockingPath) { | ||
| $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File | ||
| $currentPath = Split-Path -Path $currentPath -Parent | ||
| } |
| "datasourceType": "Microsoft.ElasticSan/elasticSans/volumeGroups", | ||
| "allowedRestoreModes": [ "RecoveryPointBased" ], | ||
| "allowedRestoreTargetTypes": [ "AlternateLocation" ], | ||
| "itemLevelRecoveyEnabled": true, |
Comment on lines
+81
to
+85
| if($DatasourceType.ToString() -eq "AzureElasticSAN"){ | ||
|
|
||
| if($ResourceIdentifier -eq $null -or $ResourceIdentifier.Count -eq 0){ | ||
| throw "Please input parameter ResourceIdentifier for DatasourceType AzureElasticSAN." | ||
| } |
Comment on lines
+112
to
+114
| if($seenTargets.ContainsKey($value)){ | ||
| throw "ResourceNameOverride target name '$value' is specified more than once. Target names must be unique." | ||
| } |
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.
AzureElasticSANdatasource type inDatasourceTypesInfo.json.Initialize-AzDataProtectionRestoreRequestto include examples for Azure Elastic SAN.New-AzDataProtectionBackupConfigurationClientObjectwith-ResourceSelectorparameter for single volume selection.ResourceIdentifierandResourceNameOverrideparameters toNew-AzDataProtectionRestoreConfigurationClientObjectfor restoring volumes.Set-AzDataProtectionMSIPermission.Description
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.