Skip to content

Conversation

@ankushbindlish2
Copy link
Member

Description

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

ankushbindlish2 and others added 10 commits July 17, 2025 00:00
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.
Copilot AI review requested due to automatic review settings December 4, 2025 23:42
@azure-client-tools-bot-prd
Copy link

Thanks for your contribution! The pull request validation has started. Please revisit this comment for updated status.

@isra-fel
Copy link
Member

isra-fel commented Dec 4, 2025

/azp run

@ankushbindlish2 ankushbindlish2 changed the title Change enumeration interval days with 2025 09 01 [NEW API] [DO NOT MERGE] Add Change enumeration interval days optional property to New CloudEndpoint. Add Set CloudEndpoint command Dec 4, 2025
@azure-pipelines
Copy link
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

Copy link
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 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-AzStorageSyncCloudEndpoint cmdlet to update cloud endpoint properties
  • Extended New-AzStorageSyncCloudEndpoint with optional ChangeEnumerationIntervalDays parameter
  • 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

Comment on lines +21 to +27
* 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
Copy link

Copilot AI Dec 4, 2025

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.

Copilot generated this review using guidance from repository custom instructions.
Copy link
Member Author

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

Comment on lines +35 to +36
[Cmdlet(VerbsCommon.Set, StorageSyncNouns.NounAzureRmStorageSyncCloudEndpoint,
DefaultParameterSetName = StorageSyncParameterSets.StringParameterSet, SupportsShouldProcess = true), OutputType(typeof(PSCloudEndpoint))]
Copy link

Copilot AI Dec 4, 2025

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:

  1. Setting ChangeEnumerationIntervalDays on a new cloud endpoint
  2. Updating ChangeEnumerationIntervalDays on an existing endpoint
  3. Validation of the 1-20 day range
  4. Different parameter sets (StringParameterSet, ResourceIdParameterSet, ObjectParameterSet)

Copilot uses AI. Check for mistakes.
@isra-fel
Copy link
Member

isra-fel commented Dec 5, 2025

/azp run

@azure-pipelines
Copy link
Contributor

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.
Copilot AI review requested due to automatic review settings December 5, 2025 04:26
Updated Az.StorageSync.psd1 to include Set-AzStorageSyncCloudEndpoint in the CmdletsToExport list, enabling users to access this cmdlet from the module.
@NoriZC
Copy link
Contributor

NoriZC commented Dec 5, 2025

/azp run

@azure-pipelines
Copy link
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

Copilot finished reviewing on behalf of ankushbindlish2 December 5, 2025 04:33
Copy link
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 10 out of 21 changed files in this pull request and generated 8 comments.

Comment on lines 258 to 260
/// 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.";
Copy link

Copilot AI Dec 5, 2025

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.

Suggested change
/// 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.";

Copilot uses AI. Check for mistakes.
Comment on lines +203 to +216
// 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;
}
Copy link

Copilot AI Dec 5, 2025

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.

Copilot uses AI. Check for mistakes.
- Additional information about change #1
-->
## Upcoming Release
* Added `ChangeEnumerationIntervalDays` parameter to `New-AzStorageSyncCloudEndpoint` cmdlet
Copy link

Copilot AI Dec 5, 2025

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.

Copilot generated this review using guidance from repository custom instructions.
- 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
Copy link

Copilot AI Dec 5, 2025

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.

Copilot generated this review using guidance from repository custom instructions.
storageSyncServiceName,
parentResourceName,
resourceName,
updateParameters.ChangeEnumerationIntervalDays);
Copy link

Copilot AI Dec 5, 2025

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.

Suggested change
updateParameters.ChangeEnumerationIntervalDays);
updateParameters);

Copilot uses AI. Check for mistakes.
/// <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.";
Copy link

Copilot AI Dec 5, 2025

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."

Copilot generated this review using guidance from repository custom instructions.
```
### -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.
Copy link

Copilot AI Dec 5, 2025

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.

Copilot generated this review using guidance from repository custom instructions.
```
### -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.
Copy link

Copilot AI Dec 5, 2025

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.

Copilot generated this review using guidance from repository custom instructions.
@NoriZC
Copy link
Contributor

NoriZC commented Dec 5, 2025

/azp run

@azure-pipelines
Copy link
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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants