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 7 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.
Copilot AI review requested due to automatic review settings December 3, 2025 06:21
@azure-client-tools-bot-prd
Copy link

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

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 PR adds support for configuring the ChangeEnumerationIntervalDays property on Azure File Sync cloud endpoints. It introduces a new Set-AzStorageSyncCloudEndpoint cmdlet to update existing cloud endpoints and adds the ChangeEnumerationIntervalDays parameter to the New-AzStorageSyncCloudEndpoint cmdlet for setting the value during creation.

Key changes:

  • Added ChangeEnumerationIntervalDays optional parameter (1-20 days) to New-AzStorageSyncCloudEndpoint
  • Introduced new Set-AzStorageSyncCloudEndpoint cmdlet for updating cloud endpoint properties
  • Updated SDK models, converters, and help documentation

Reviewed changes

Copilot reviewed 9 out of 95 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/StorageSync/StorageSync/ChangeLog.md Documents new cmdlet and parameter additions
src/StorageSync/StorageSync/help/Set-AzStorageSyncCloudEndpoint.md Help documentation for new Set cmdlet
src/StorageSync/StorageSync/help/New-AzStorageSyncCloudEndpoint.md Updated help with new parameter
src/StorageSync/StorageSync/Models/PSCloudEndpoint.cs Added ChangeEnumerationIntervalDays property
src/StorageSync/StorageSync/Common/HelpMessages.cs Added help message constant for new parameter
src/StorageSync/StorageSync/Common/Converters/CloudEndpointConverter.cs Updated converter to handle new property
src/StorageSync/StorageSync/CloudEndpoint/SetCloudEndpointCommand.cs New cmdlet implementation
src/StorageSync/StorageSync/CloudEndpoint/NewCloudEndpointCommand.cs Added new parameter support
src/StorageSync/StorageSync.Management.Sdk/README.md Updated SDK commit reference
src/StorageSync/StorageSync.Management.Sdk/Generated/* Auto-generated SDK code updates from OpenAPI spec changes

Comment on lines +31 to +32
- https://github.com/ankushbindlish2/azure-rest-api-specs/blob/$(commit)/specification/storagesync/resource-manager/Microsoft.StorageSync/StorageSync/stable/2022-09-01/storagesync.json
Copy link

Copilot AI Dec 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The SDK README now points input-file to a non-official fork (github.com/ankushbindlish2/azure-rest-api-specs) instead of the trusted Azure/azure-rest-api-specs. This introduces a supply-chain risk where generated management SDK code could be built from attacker-controlled specifications, leading to malicious API surface or behavior. Restore the input-file to the official Azure/azure-rest-api-specs repository and verified commit, e.g.,

commit: <trusted Azure commit>
input-file:
  - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2022-09-01/storagesync.json

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

isra-fel commented Dec 3, 2025

/azp run

@azure-pipelines
Copy link
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

@ankushbindlish2 ankushbindlish2 changed the title Add Change enumeration interval days optional property to New CloudEndpoint. Add Set CloudEdpoint command [DO NOT MERGE] Add Change enumeration interval days optional property to New CloudEndpoint. Add Set CloudEdpoint command Dec 4, 2025
@ankushbindlish2 ankushbindlish2 changed the title [DO NOT MERGE] Add Change enumeration interval days optional property to New CloudEndpoint. Add Set CloudEdpoint command [DO NOT MERGE] Add Change enumeration interval days optional property to New CloudEndpoint. Add Set CloudEndpoint command Dec 4, 2025
@YanaXu
Copy link
Contributor

YanaXu commented Dec 4, 2025

/azp run

@azure-pipelines
Copy link
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

Refactored all references of ChangeEnumerationIntervalDays to ChangeEnumerationIntervalDay across cmdlets, models, converters, help messages, and documentation for consistency. Updated parameter names, help text, and usage examples to reflect the new naming convention.
Copilot AI review requested due to automatic review settings December 4, 2025 23:30
@ankushbindlish2
Copy link
Member Author

/azp run

@azure-pipelines
Copy link
Contributor

Commenter does not have sufficient privileges for PR 28949 in repo Azure/azure-powershell

Copilot finished reviewing on behalf of ankushbindlish2 December 4, 2025 23:35
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 20 changed files in this pull request and generated 4 comments.

'Set-AzStorageSyncServerEndpointPermission',
'Set-AzStorageSyncService', 'Set-AzStorageSyncServiceIdentity',
'Unregister-AzStorageSyncServer'
'Unregister-AzStorageSyncServer','Set-AzStorageSyncCloudEndpoint'
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.

Missing space after the comma before 'Set-AzStorageSyncCloudEndpoint'. For consistency with the formatting of the rest of the array, add a space after the comma:

'Unregister-AzStorageSyncServer', 'Set-AzStorageSyncCloudEndpoint'
Suggested change
'Unregister-AzStorageSyncServer','Set-AzStorageSyncCloudEndpoint'
'Unregister-AzStorageSyncServer', 'Set-AzStorageSyncCloudEndpoint'

Copilot uses AI. Check for mistakes.
---
external help file: Microsoft.Azure.PowerShell.Cmdlets.StorageSync.dll-Help.xml
Module Name: Az.StorageSync
online version: https://learn.microsoft.com/powershell/module/Az.storagesync/set-Azstoragesynccloudendpoint
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.

Inconsistent casing in the online version URL. The URL should use lowercase for consistency with PowerShell documentation standards. Change set-Azstoragesynccloudendpoint to set-azstoragesynccloudendpoint.

Suggested change
online version: https://learn.microsoft.com/powershell/module/Az.storagesync/set-Azstoragesynccloudendpoint
online version: https://learn.microsoft.com/powershell/module/az.storagesync/set-azstoragesynccloudendpoint

Copilot uses AI. Check for mistakes.
Comment on lines 204 to 230
var updateParameters = new CloudEndpointCreateParameters()
{
StorageAccountResourceId = existingCloudEndpoint.StorageAccountResourceId,
AzureFileShareName = existingCloudEndpoint.AzureFileShareName,
StorageAccountTenantId = existingCloudEndpoint.StorageAccountTenantId,
FriendlyName = existingCloudEndpoint.FriendlyName
};

// 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;
}

Target = string.Join("/", resourceGroupName, storageSyncServiceName, parentResourceName, resourceName);
if (ShouldProcess(Target, ActionMessage))
{
StorageSyncModels.CloudEndpoint resource = StorageSyncClientWrapper.StorageSyncManagementClient.CloudEndpoints.Create(
resourceGroupName,
storageSyncServiceName,
parentResourceName,
resourceName,
updateParameters);
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 Set-AzStorageSyncCloudEndpoint cmdlet is using CloudEndpointCreateParameters and calling the Create method instead of using the proper Update API. The SDK has generated CloudEndpointUpdateParameters and an Update method that should be used instead.

This approach is problematic because:

  1. It uses the Create API for updates, which is not semantically correct
  2. It requires fetching and re-specifying all existing properties
  3. The SDK provides proper Update types that are being ignored

The implementation should follow the same pattern as SetServerEndpointCommand.cs (lines 270-275), which uses ServerEndpointUpdateParameters and calls the Update method:

var updateParameters = new CloudEndpointUpdateProperties();
if (this.IsParameterBound(c => c.ChangeEnumerationIntervalDay))
{
    updateParameters.ChangeEnumerationIntervalDays = ChangeEnumerationIntervalDay;
}

CloudEndpoint resource = StorageSyncClientWrapper.StorageSyncManagementClient.CloudEndpoints.Update(
    resourceGroupName,
    storageSyncServiceName,
    parentResourceName,
    resourceName,
    updateParameters);

Copilot uses AI. Check for mistakes.
Comment on lines +21 to +27
* Added `ChangeEnumerationIntervalDay` 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 `ChangeEnumerationIntervalDay` 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 should reference related GitHub issues if applicable. Per the ChangeLog guidelines, include issue references using the format [#12345] for bug fixes, feature implementations, and breaking changes to help users track the context and history of these changes.

Copilot generated this review using guidance from repository custom instructions.
@ankushbindlish2 ankushbindlish2 changed the title [DO NOT MERGE] Add Change enumeration interval days optional property to New CloudEndpoint. Add Set CloudEndpoint command [Current API] [DO NOT MERGE] Add Change enumeration interval days optional property to New CloudEndpoint. Add Set CloudEndpoint command Dec 4, 2025
@dolauli
Copy link
Contributor

dolauli commented Dec 5, 2025

/azp run

@azure-pipelines
Copy link
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

@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).

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.

4 participants