Skip to content

[ChangeSafety] Fix base calls in GetDynamicParameters#29222

Open
notyashhh wants to merge 73 commits intomainfrom
yash/dynamic-parameter-fix
Open

[ChangeSafety] Fix base calls in GetDynamicParameters#29222
notyashhh wants to merge 73 commits intomainfrom
yash/dynamic-parameter-fix

Conversation

@notyashhh
Copy link
Copy Markdown
Member

@notyashhh notyashhh commented Mar 2, 2026

Description

Fixes GetDynamicParameters() overrides across 6 modules to properly chain to base.GetDynamicParameters(). This ensures dynamic parameters from base classes are inherited correctly — required for the upcoming Change Safety parameters (-AcquirePolicyToken, -ChangeReference) from azure-powershell-common.

Common PR: Azure/azure-powershell-common#449

Modules changed

Module Files What was fixed
Accounts ConfigCommandBase.cs Added base parameter inheritance in config command helper
CosmosDB NewAzCosmosDBAccount.cs Call base.GetDynamicParameters() instead of returning null
DataMigration InvokeDataMigrationCommand.cs, NewConnectionInfoCmdlet.cs, NewDataMigrationTask.cs Merge base parameters with module-specific dynamic parameters
IotHub AddAzIotHubDevice.cs, SetAzIotHubDevice.cs, AddAzIotHubModule.cs, SetAzIotHubModule.cs, AddAzureRmIotHubRoutingEndpoint.cs Call base.GetDynamicParameters() and return base result in default case
Network PrivateEndpointConnectionBaseCmdlet.cs, GetAzurePrivateLinkResourceCommand.cs Call base.GetDynamicParameters() instead of creating empty dictionary
Resources DeploymentCmdletBase.cs, DeploymentStacksCreateCmdletBase.cs Chain to base dynamic parameters

Impact

  • No functional change to existing cmdlet behavior
  • All previously returned parameters continue to work
  • Base class parameters are now additionally inherited
  • Verified by building and testing with connected azure-powershell-common repo

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

Copilot AI review requested due to automatic review settings March 2, 2026 06:37
@azure-client-tools-bot-prd
Copy link
Copy Markdown

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

@notyashhh notyashhh changed the title []Fix base calls in GetDynamicParameters [ChangeSafety] Fix base calls in GetDynamicParameters Mar 2, 2026
Copy link
Copy Markdown
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 updates several cmdlets’ GetDynamicParameters() implementations to preserve and return dynamic parameters provided by base cmdlet classes, instead of returning null or always starting from a new empty dictionary. This helps ensure inherited dynamic parameters (from AzureRMCmdlet/AzurePSCmdlet/module base cmdlets) continue to flow through when a cmdlet doesn’t add its own dynamic parameters.

Changes:

  • Return base.GetDynamicParameters() instead of null when no custom dynamic parameters are needed (Storage, IoTHub, CosmosDB).
  • Seed RuntimeDefinedParameterDictionary instances from base.GetDynamicParameters() before adding cmdlet-specific runtime parameters (Network, Resources, DataMigration, Accounts config).
  • Minor whitespace-only change in TestDeploymentCmdletBase.

Reviewed changes

Copilot reviewed 16 out of 17 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/Storage/Storage/File/Cmdlet/SetAzureStorageFileContent.cs Returns base dynamic parameters on non-Windows instead of null.
src/Storage/Storage/File/Cmdlet/GetAzureStorageFileContent.cs Returns base dynamic parameters on non-Windows instead of null.
src/Resources/ResourceManager/Implementation/CmdletBase/TestDeploymentCmdletBase.cs Whitespace-only change in method spacing.
src/Resources/ResourceManager/Implementation/CmdletBase/DeploymentStacksCreateCmdletBase.cs Seeds dynamic parameter dictionary from base.GetDynamicParameters().
src/Resources/ResourceManager/Implementation/CmdletBase/DeploymentCmdletBase.cs Seeds dynamic parameter dictionary from base.GetDynamicParameters().
src/Network/Network/PrivateLinkService/PrivateLinkResource/GetAzurePrivateLinkResourceCommand.cs Seeds runtime parameter dictionary from base before adding provider-specific parameter.
src/Network/Network/PrivateLinkService/PrivateEndpointConnection/PrivateEndpointConnectionBaseCmdlet.cs Seeds runtime parameter dictionary from base before adding provider-specific parameter.
src/IotHub/IotHub/IotHub/Routing/AddAzureRmIotHubRoutingEndpoint.cs Returns base dynamic parameters when endpoint type doesn’t require custom dynamic params.
src/IotHub/IotHub/IotHub/DataPlane/Module/SetAzIotHubModule.cs Returns base dynamic parameters when auth method doesn’t require custom dynamic params.
src/IotHub/IotHub/IotHub/DataPlane/Module/AddAzIotHubModule.cs Returns base dynamic parameters when auth method doesn’t require custom dynamic params.
src/IotHub/IotHub/IotHub/DataPlane/Device/SetAzIotHubDevice.cs Returns base dynamic parameters when auth method doesn’t require custom dynamic params.
src/IotHub/IotHub/IotHub/DataPlane/Device/AddAzIotHubDevice.cs Returns base dynamic parameters when auth method doesn’t require custom dynamic params.
src/DataMigration/DataMigration/Cmdlets/NewDataMigrationTask.cs Merges base dynamic parameters with task-type-specific runtime params and returns combined dictionary.
src/DataMigration/DataMigration/Cmdlets/NewConnectionInfoCmdlet.cs Merges base dynamic parameters with server-type-specific runtime params and returns combined dictionary.
src/DataMigration/DataMigration/Cmdlets/InvokeDataMigrationCommand.cs Merges base dynamic parameters with command-type-specific runtime params and returns combined dictionary.
src/CosmosDB/CosmosDB/CosmosDBAccount/NewAzCosmosDBAccount.cs Returns base dynamic parameters when PIT restore dynamic params aren’t used.
src/Accounts/Accounts/Config/ConfigCommandBase.cs Preserves base-class dynamic parameters before adding config-key runtime params.

return base.GetDynamicParameters();
}

Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

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

Line contains trailing whitespace (blank line with spaces). Please remove the extra spaces to avoid unnecessary diffs and formatting noise.

Suggested change

Copilot uses AI. Check for mistakes.
isra-fel
isra-fel previously approved these changes Mar 6, 2026
Copy link
Copy Markdown
Member

@isra-fel isra-fel left a comment

Choose a reason for hiding this comment

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

Consider updating the ChangeLog.md file for these modules cause otherwise the change safety work still won't be reflected on them.

This could of cause be defered to the same release of the wave 1 work of change safety. So I'll approve the PR first and let you decide @notyashhh

Joselyn-Narvaez and others added 21 commits March 24, 2026 19:25
Co-authored-by: Joselyn Narvaez <jnarvaez@microsoft.com>
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Lauren Kam <laurenkam@microsoft.com>
…dd-AzVMDataDisk (#29194)

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: audreyttt <225061541+audreyttt@users.noreply.github.com>
Co-authored-by: Yeming Liu <yeliu@microsoft.com>
…table (#28902)

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Yash <55773468+notyashhh@users.noreply.github.com>
Co-authored-by: Yeming Liu <11371776+isra-fel@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…hedulers (#29218)

Co-authored-by: Bernd Verst <beverst@microsoft.com>
Copy link
Copy Markdown
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 23 out of 3431 changed files in this pull request and generated 15 comments.

Comments suppressed due to low confidence (1)

documentation/breaking-changes/upcoming-breaking-changes.md:1

  • This entry is internally inconsistent: it states the output type is 'bool' but then describes deprecated/added properties on the output type. If the cmdlet returns a boolean, the property-change bullets should be removed; if the cmdlet returns a model type, the output type line should be corrected accordingly.
# Upcoming breaking changes in Azure PowerShell

@notyashhh
Copy link
Copy Markdown
Member Author

@isra-fel Requesting a review again.
Updated the changelogs & ready to be merged!

@notyashhh notyashhh requested a review from Copilot March 24, 2026 08:33
@notyashhh
Copy link
Copy Markdown
Member Author

Related change in powershell common: Azure/azure-powershell-common#449

Copy link
Copy Markdown
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 20 out of 21 changed files in this pull request and generated 2 comments.

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.