-
Notifications
You must be signed in to change notification settings - Fork 4.1k
[Current API] [DO NOT MERGE] Add Change enumeration interval days optional property to New CloudEndpoint. Add Set CloudEndpoint command #28949
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.
| Thanks for your contribution! The pull request validation has started. Please revisit this comment for updated status. |
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 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
ChangeEnumerationIntervalDaysoptional parameter (1-20 days) toNew-AzStorageSyncCloudEndpoint - Introduced new
Set-AzStorageSyncCloudEndpointcmdlet 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 |
| - https://github.com/ankushbindlish2/azure-rest-api-specs/blob/$(commit)/specification/storagesync/resource-manager/Microsoft.StorageSync/StorageSync/stable/2022-09-01/storagesync.json | ||
Copilot
AI
Dec 3, 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 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|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
/azp run |
|
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.
|
/azp run |
|
Commenter does not have sufficient privileges for PR 28949 in repo Azure/azure-powershell |
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 20 changed files in this pull request and generated 4 comments.
| 'Set-AzStorageSyncServerEndpointPermission', | ||
| 'Set-AzStorageSyncService', 'Set-AzStorageSyncServiceIdentity', | ||
| 'Unregister-AzStorageSyncServer' | ||
| 'Unregister-AzStorageSyncServer','Set-AzStorageSyncCloudEndpoint' |
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.
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'| 'Unregister-AzStorageSyncServer','Set-AzStorageSyncCloudEndpoint' | |
| 'Unregister-AzStorageSyncServer', 'Set-AzStorageSyncCloudEndpoint' |
| --- | ||
| 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 |
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.
Inconsistent casing in the online version URL. The URL should use lowercase for consistency with PowerShell documentation standards. Change set-Azstoragesynccloudendpoint to set-azstoragesynccloudendpoint.
| online version: https://learn.microsoft.com/powershell/module/Az.storagesync/set-Azstoragesynccloudendpoint | |
| online version: https://learn.microsoft.com/powershell/module/az.storagesync/set-azstoragesynccloudendpoint |
| 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); |
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 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:
- It uses the Create API for updates, which is not semantically correct
- It requires fetching and re-specifying all existing properties
- 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);| * 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 |
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 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.
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
/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.