-
Notifications
You must be signed in to change notification settings - Fork 4.1k
[NEW API] [DO NOT MERGE] Add Change enumeration interval days optional property to New CloudEndpoint. Add Set CloudEndpoint command #28956
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
This commit introduces support for configuring the change enumeration interval for cloud endpoints in Azure File Sync. Changes include: - Added ChangeEnumerationIntervalDays parameter to New-AzStorageSyncCloudEndpoint cmdlet * Optional parameter with ValidateRange(1, 20) attribute * Allows customers to control the interval between change enumeration operations - Created new Set-AzStorageSyncCloudEndpoint cmdlet * Enables updating ChangeEnumerationIntervalDays on existing cloud endpoints * Supports three parameter sets: StringParameterSet, ResourceIdParameterSet, ObjectParameterSet * Supports pipeline input for flexible usage - Updated SDK models: * CloudEndpoint - added ChangeEnumerationIntervalDays property * CloudEndpointCreateParameters - added parameter support * CloudEndpointCreateParametersProperties - added property * CloudEndpointUpdateParameters - new model for update operations - Updated PowerShell models and converters: * PSCloudEndpoint - added ChangeEnumerationIntervalDays property * CloudEndpointConverter - updated Transform methods to handle new property - Added comprehensive documentation: * Updated New-AzStorageSyncCloudEndpoint.md with parameter details * Created Set-AzStorageSyncCloudEndpoint.md with full cmdlet documentation * Updated ChangeLog.md with feature descriptions Valid range: 1 to 20 days
Reordered and refactored CloudEndpointsOperations methods to align with REST conventions. Swapped method signatures and implementations for Create, Get, ListBySyncGroup, Update, and Delete operations, and updated documentation and tracing accordingly. Added support for new AfsShareMetadataCertificatePublicKeys API and adjusted method parameters for consistency.
Introduces validation logic to ensure ChangeEnumerationIntervalDays is between 1 and 20 in CloudEndpoint models and parameter classes. Updates CloudEndpoint update methods to accept changeEnumerationIntervalDays directly instead of properties, and bumps API version to 2025-12-01.
| Thanks for your contribution! The pull request validation has started. Please revisit this comment for updated status. |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
There was a problem hiding this 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 pull request adds support for configuring change enumeration intervals on Azure File Sync cloud endpoints. The change introduces a new ChangeEnumerationIntervalDays parameter (valid range: 1-20 days) to control the frequency of change detection operations. The implementation includes a new Set-AzStorageSyncCloudEndpoint cmdlet for updating existing cloud endpoints and extends New-AzStorageSyncCloudEndpoint to accept this parameter during creation. The PR also updates the Storage Sync Management SDK to API version 2025-12-01.
Key changes:
- Added
Set-AzStorageSyncCloudEndpointcmdlet to update cloud endpoint properties - Extended
New-AzStorageSyncCloudEndpointwith optionalChangeEnumerationIntervalDaysparameter - Updated SDK from API version 2022-09-01 to 2025-12-01
Reviewed changes
Copilot reviewed 9 out of 20 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/StorageSync/StorageSync/ChangeLog.md | Added user-facing changelog entries for new cmdlet and parameter |
| src/StorageSync/StorageSync/help/Set-AzStorageSyncCloudEndpoint.md | New help documentation for Set-AzStorageSyncCloudEndpoint cmdlet |
| src/StorageSync/StorageSync/help/New-AzStorageSyncCloudEndpoint.md | Updated help to document ChangeEnumerationIntervalDays parameter |
| src/StorageSync/StorageSync/CloudEndpoint/SetCloudEndpointCommand.cs | New cmdlet implementation supporting three parameter sets for updating cloud endpoints |
| src/StorageSync/StorageSync/CloudEndpoint/NewCloudEndpointCommand.cs | Added ChangeEnumerationIntervalDays parameter support |
| src/StorageSync/StorageSync/Models/PSCloudEndpoint.cs | Added ChangeEnumerationIntervalDays property to PowerShell model |
| src/StorageSync/StorageSync/Common/HelpMessages.cs | Added help message constant for the new parameter |
| src/StorageSync/StorageSync/Common/Converters/CloudEndpointConverter.cs | Updated converter to map ChangeEnumerationIntervalDays between SDK and PS models |
| src/StorageSync/StorageSync.Management.Sdk/README.md | Updated AutoRest configuration to use API version 2025-12-01 |
| src/StorageSync/StorageSync.Management.Sdk/Generated/StorageSyncManagementClient.cs | Updated API version constant to 2025-12-01 |
| src/StorageSync/StorageSync.Management.Sdk/Generated/Models/CloudEndpoint*.cs | Generated SDK models supporting ChangeEnumerationIntervalDays property with validation |
| src/StorageSync/StorageSync.Management.Sdk/Generated/ICloudEndpointsOperations.cs | Added Update operation interface for cloud endpoints |
| src/StorageSync/StorageSync.Management.Sdk/Generated/CloudEndpointsOperations*.cs | Implemented Update and BeginUpdate operations with PATCH HTTP method |
| * Added `ChangeEnumerationIntervalDays` parameter to `New-AzStorageSyncCloudEndpoint` cmdlet | ||
| - Allows customers to configure the interval in days between change enumeration operations for cloud endpoints | ||
| - Valid range: 1 to 20 days | ||
| - Optional parameter that provides control over change detection frequency | ||
| * Added `Set-AzStorageSyncCloudEndpoint` cmdlet | ||
| - Allows customers to update the `ChangeEnumerationIntervalDays` property of an existing cloud endpoint | ||
| - Valid range: 1 to 20 days |
Copilot
AI
Dec 4, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changelog entries use backticks around parameter names (e.g., ChangeEnumerationIntervalDays, New-AzStorageSyncCloudEndpoint), which is acceptable according to the guidelines. However, for consistency with PowerShell module manifest compatibility, consider using simple quotes instead (e.g., 'ChangeEnumerationIntervalDays'). Backticks are automatically converted to single quotes in release notes, so either format is acceptable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot open a new pull request to apply changes based on this feedback
src/StorageSync/StorageSync/CloudEndpoint/SetCloudEndpointCommand.cs
Outdated
Show resolved
Hide resolved
| [Cmdlet(VerbsCommon.Set, StorageSyncNouns.NounAzureRmStorageSyncCloudEndpoint, | ||
| DefaultParameterSetName = StorageSyncParameterSets.StringParameterSet, SupportsShouldProcess = true), OutputType(typeof(PSCloudEndpoint))] |
Copilot
AI
Dec 4, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new Set-AzStorageSyncCloudEndpoint cmdlet lacks test coverage. The repository has comprehensive test files in src/StorageSync/StorageSync.Test/ScenarioTests/CloudEndpointTests.ps1, but no tests were added for this new cmdlet or the ChangeEnumerationIntervalDays parameter. Consider adding test cases that cover:
- Setting ChangeEnumerationIntervalDays on a new cloud endpoint
- Updating ChangeEnumerationIntervalDays on an existing endpoint
- Validation of the 1-20 day range
- Different parameter sets (StringParameterSet, ResourceIdParameterSet, ObjectParameterSet)
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
Refactored parameter and related references from ChangeEnumerationIntervalDays to ChangeEnumerationIntervalDay in NewCloudEndpointCommand, SetCloudEndpointCommand, and their help documentation for clarity and consistency.
Updated Az.StorageSync.psd1 to include Set-AzStorageSyncCloudEndpoint in the CmdletsToExport list, enabling users to access this cmdlet from the module.
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
There was a problem hiding this 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 10 out of 21 changed files in this pull request and generated 8 comments.
| /// The change enumeration interval days parameter | ||
| /// </summary> | ||
| public const string ChangeEnumerationIntervalDaysParameter = "Change Enumeration Interval Days. This parameter defines the interval in days between change enumeration operations for the cloud endpoint. Valid values range from 1 to 20 days."; |
Copilot
AI
Dec 5, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The help message constant name ChangeEnumerationIntervalDaysParameter uses the plural form "Days", but the actual parameter name is ChangeEnumerationIntervalDay (singular). For consistency, consider naming this constant ChangeEnumerationIntervalDayParameter to match the parameter name.
| /// The change enumeration interval days parameter | |
| /// </summary> | |
| public const string ChangeEnumerationIntervalDaysParameter = "Change Enumeration Interval Days. This parameter defines the interval in days between change enumeration operations for the cloud endpoint. Valid values range from 1 to 20 days."; | |
| /// The change enumeration interval day parameter | |
| /// </summary> | |
| public const string ChangeEnumerationIntervalDayParameter = "Change Enumeration Interval Days. This parameter defines the interval in days between change enumeration operations for the cloud endpoint. Valid values range from 1 to 20 days."; |
| // Create update parameters with the existing values and new ChangeEnumerationIntervalDay | ||
| var updateParameters = new CloudEndpointUpdateParameters() | ||
| { | ||
| }; | ||
|
|
||
| // Apply the update if parameter is provided | ||
| if (this.IsParameterBound(c => c.ChangeEnumerationIntervalDay)) | ||
| { | ||
| updateParameters.ChangeEnumerationIntervalDays = ChangeEnumerationIntervalDay; | ||
| } | ||
| else if (existingCloudEndpoint.ChangeEnumerationIntervalDays.HasValue) | ||
| { | ||
| updateParameters.ChangeEnumerationIntervalDays = existingCloudEndpoint.ChangeEnumerationIntervalDays; | ||
| } |
Copilot
AI
Dec 5, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The CloudEndpointUpdateParameters object is created but never used. It's created at line 204, populated at lines 211 and 215, but then only the ChangeEnumerationIntervalDays property is passed to the Update method at line 226. Since the Update method signature expects int? changeEnumerationIntervalDays directly, you should simplify this code to work directly with an int? variable instead of creating an unused object.
| - Additional information about change #1 | ||
| --> | ||
| ## Upcoming Release | ||
| * Added `ChangeEnumerationIntervalDays` parameter to `New-AzStorageSyncCloudEndpoint` cmdlet |
Copilot
AI
Dec 5, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The parameter name in the ChangeLog should be ChangeEnumerationIntervalDay (singular), not ChangeEnumerationIntervalDays (plural), to match the actual cmdlet parameter name used in the code.
| - Valid range: 1 to 20 days | ||
| - Optional parameter that provides control over change detection frequency | ||
| * Added `Set-AzStorageSyncCloudEndpoint` cmdlet | ||
| - Allows customers to update the `ChangeEnumerationIntervalDays` property of an existing cloud endpoint |
Copilot
AI
Dec 5, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The parameter name in the ChangeLog should be ChangeEnumerationIntervalDay (singular), not ChangeEnumerationIntervalDays (plural), to match the actual cmdlet parameter name used in the code.
| storageSyncServiceName, | ||
| parentResourceName, | ||
| resourceName, | ||
| updateParameters.ChangeEnumerationIntervalDays); |
Copilot
AI
Dec 5, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Update method is being called with a single parameter updateParameters.ChangeEnumerationIntervalDays, but the method signature expects the full CloudEndpointUpdateParameters object. This should be updateParameters instead of updateParameters.ChangeEnumerationIntervalDays.
| updateParameters.ChangeEnumerationIntervalDays); | |
| updateParameters); |
| /// <summary> | ||
| /// The change enumeration interval days parameter | ||
| /// </summary> | ||
| public const string ChangeEnumerationIntervalDaysParameter = "Change Enumeration Interval Days. This parameter defines the interval in days between change enumeration operations for the cloud endpoint. Valid values range from 1 to 20 days."; |
Copilot
AI
Dec 5, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The help message should be more concise and avoid over-explanation. Consider simplifying to: "Interval in days between change enumeration operations for the cloud endpoint (1-20 days)." The current message is somewhat redundant with "This parameter defines the interval in days" and then repeating "Valid values range from 1 to 20 days."
| ``` | ||
| ### -ChangeEnumerationIntervalDay | ||
| Change Enumeration Interval Day. This parameter defines the interval in days between change enumeration operations for the cloud endpoint. Valid values range from 1 to 20 days. |
Copilot
AI
Dec 5, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The parameter description is redundant. Consider simplifying to: "Interval in days between change enumeration operations for the cloud endpoint. Valid values range from 1 to 20 days." This avoids the redundancy of "This parameter defines the interval in days" followed immediately by defining the interval.
| ``` | ||
| ### -ChangeEnumerationIntervalDay | ||
| Change Enumeration Interval Day. This parameter defines the interval in days between change enumeration operations for the cloud endpoint. Valid values range from 1 to 20 days. |
Copilot
AI
Dec 5, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The parameter description is redundant. Consider simplifying to: "Interval in days between change enumeration operations for the cloud endpoint. Valid values range from 1 to 20 days." This avoids the redundancy of "This parameter defines the interval in days" followed immediately by defining the interval.
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
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.