Skip to content

[PS] Migrate ManagedServices module to autorest v4#29561

Closed
khang-11 wants to merge 9 commits into
Azure:mainfrom
khang-11:recreate/pr-27929
Closed

[PS] Migrate ManagedServices module to autorest v4#29561
khang-11 wants to merge 9 commits into
Azure:mainfrom
khang-11:recreate/pr-27929

Conversation

@khang-11

Copy link
Copy Markdown
Contributor

Description

Preannouncement PR:

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 May 12, 2026 03:32
@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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 migrates the Az.ManagedServices module generation to AutoRest PowerShell v4, updating the module’s generated surface area (cmdlets, help/docs, and metadata) and adding/refreshing breaking-change suppressions for static analysis.

Changes:

  • Added/updated cmdlet help and docs for the v4-generated cmdlets, including the new Update-AzManagedServicesDefinition.
  • Updated AutoRest configuration and generated assets (manifest exports, solution/project metadata, assembly version).
  • Added static-analysis breaking-change exception entries for Az.ManagedServices.

Reviewed changes

Copilot reviewed 38 out of 38 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
tools/StaticAnalysis/Exceptions/Az.ManagedServices/BreakingChangeIssues.csv Adds breaking-change suppressions for ManagedServices after v4 regeneration.
src/ManagedServices/ManagedServices/help/Update-AzManagedServicesDefinition.md Adds user help for the new Update cmdlet.
src/ManagedServices/ManagedServices/help/Remove-AzManagedServicesDefinition.md Updates help text (removes complex-parameter construction hint).
src/ManagedServices/ManagedServices/help/Remove-AzManagedServicesAssignment.md Updates help text (removes complex-parameter construction hint).
src/ManagedServices/ManagedServices/help/New-AzManagedServicesEligibleAuthorizationObject.md Updates help output/types and parameter typing for v4.
src/ManagedServices/ManagedServices/help/New-AzManagedServicesEligibleApproverObject.md Updates help output/types and online link casing.
src/ManagedServices/ManagedServices/help/New-AzManagedServicesDefinition.md Updates help (adds JSON parameter sets and type names).
src/ManagedServices/ManagedServices/help/New-AzManagedServicesAuthorizationObject.md Updates help output/types and online link casing.
src/ManagedServices/ManagedServices/help/New-AzManagedServicesAssignment.md Updates help (adds JSON parameter sets and type names).
src/ManagedServices/ManagedServices/help/Get-AzManagedServicesMarketplaceDefinition.md Updates output type names for v4.
src/ManagedServices/ManagedServices/help/Get-AzManagedServicesDefinition.md Updates output type names and help text.
src/ManagedServices/ManagedServices/help/Get-AzManagedServicesAssignment.md Updates output type names and help text.
src/ManagedServices/ManagedServices/help/Az.ManagedServices.md Updates module index entries and adds Update cmdlet entry.
src/ManagedServices/ManagedServices/ChangeLog.md Adds an Upcoming Release note for the generator upgrade.
src/ManagedServices/ManagedServices/Az.ManagedServices.psd1 Updates exports (adds Update cmdlet) and normalizes some manifest fields.
src/ManagedServices/ManagedServices.sln Updates the solution’s project GUID mapping for the generated project.
src/ManagedServices/ManagedServices.Autorest/test/Update-AzManagedServicesDefinition.Tests.ps1 Adds placeholder Pester test file for the new cmdlet.
src/ManagedServices/ManagedServices.Autorest/README.md Updates AutoRest v4 config/directives and model-cmdlet generation list.
src/ManagedServices/ManagedServices.Autorest/Properties/AssemblyInfo.cs Bumps assembly version metadata.
src/ManagedServices/ManagedServices.Autorest/generate-info.json Updates generation ID.
src/ManagedServices/ManagedServices.Autorest/examples/Update-AzManagedServicesDefinition.md Adds an example markdown for Update cmdlet.
src/ManagedServices/ManagedServices.Autorest/docs/Update-AzManagedServicesDefinition.md Adds generated docs page for Update cmdlet.
src/ManagedServices/ManagedServices.Autorest/docs/Remove-AzManagedServicesDefinition.md Updates generated docs (removes complex-parameter construction hint).
src/ManagedServices/ManagedServices.Autorest/docs/Remove-AzManagedServicesAssignment.md Updates generated docs (removes complex-parameter construction hint).
src/ManagedServices/ManagedServices.Autorest/docs/New-AzManagedServicesEligibleAuthorizationObject.md Updates generated docs for v4 type/parameter changes.
src/ManagedServices/ManagedServices.Autorest/docs/New-AzManagedServicesEligibleApproverObject.md Updates generated docs output/types and online link casing.
src/ManagedServices/ManagedServices.Autorest/docs/New-AzManagedServicesDefinition.md Updates generated docs (adds JSON parameter sets and type names).
src/ManagedServices/ManagedServices.Autorest/docs/New-AzManagedServicesAuthorizationObject.md Updates generated docs output/types and online link casing.
src/ManagedServices/ManagedServices.Autorest/docs/New-AzManagedServicesAssignment.md Updates generated docs (adds JSON parameter sets and type names).
src/ManagedServices/ManagedServices.Autorest/docs/Get-AzManagedServicesMarketplaceDefinition.md Updates generated docs output type names.
src/ManagedServices/ManagedServices.Autorest/docs/Get-AzManagedServicesDefinition.md Updates generated docs output type names and help text.
src/ManagedServices/ManagedServices.Autorest/docs/Get-AzManagedServicesAssignment.md Updates generated docs output type names and help text.
src/ManagedServices/ManagedServices.Autorest/docs/Az.ManagedServices.md Updates generated module index entries and adds Update cmdlet entry.
src/ManagedServices/ManagedServices.Autorest/custom/New-AzManagedServicesEligibleAuthorizationObject.ps1 Updates custom model cmdlet (type changes + argument completer) for v4.
src/ManagedServices/ManagedServices.Autorest/custom/New-AzManagedServicesAuthorizationObject.ps1 Updates custom Authorization model cmdlet (adds model cmdlet attribute + type changes).
src/ManagedServices/ManagedServices.Autorest/custom/Get-AzManagedServicesMarketplaceDefinition.ps1 Updates output type declaration to v4 type namespace.
src/ManagedServices/ManagedServices.Autorest/custom/autogen-model-cmdlets/New-AzManagedServicesEligibleApproverObject.ps1 Updates generated model cmdlet output/type namespace for v4.
src/ManagedServices/ManagedServices.Autorest/custom/autogen-model-cmdlets/New-AzManagedServicesAuthorizationObject.ps1 Adds generated Authorization model cmdlet (currently duplicates the custom one).

Comment on lines 156 to 160
# Generate memory object as parameter of the cmelet.
- model-cmdlet:
# - Authorization
- EligibleApprover
- model-name: Authorization
- model-name: EligibleApprover
# Need custom that add ArgumentCompleterAttribute for JustInTimeAccessPolicyMultiFactorAuthProvider parameter.
where: $
transform: $ = $.replace(/global::System.Text.RegularExpressions.Regex\(\"\^\/\(\?\<scope\>\[\^\/\]\+\)/g, 'global::System.Text.RegularExpressions.Regex("^/(?<scope>.+)');

# Generate memory object as parameter of the cmelet.
Comment on lines 10 to 12
## SYNOPSIS
Creates or updates a registration definition.
Create a registration definition.

Comment on lines 10 to 12
## SYNOPSIS
Creates or updates a registration assignment.
Create a registration assignment.


### [New-AzManagedServicesAssignment](New-AzManagedServicesAssignment.md)
Creates or updates a registration assignment.
Create a registration assignment.

### [New-AzManagedServicesDefinition](New-AzManagedServicesDefinition.md)
Creates or updates a registration definition.
Create a registration definition.
Comment on lines +39 to +42
```powershell
$permantAuth = New-AzManagedServicesAuthorizationObject -PrincipalId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -RoleDefinitionId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -PrincipalIdDisplayName "Test user" -DelegatedRoleDefinitionId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx","xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"

Update-AzManagedServicesDefinition -Name xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx -RegistrationDefinitionName "Test definition" -ManagedByTenantId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -Authorization $permantAuth -Description "Test definition desc" -Scope "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
Comment on lines +3 to +6
$permantAuth = New-AzManagedServicesAuthorizationObject -PrincipalId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -RoleDefinitionId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -PrincipalIdDisplayName "Test user" -DelegatedRoleDefinitionId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx","xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"

Update-AzManagedServicesDefinition -Name xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx -RegistrationDefinitionName "Test definition" -ManagedByTenantId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -Authorization $permantAuth -Description "Test definition desc" -Scope "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
```
- Additional information about change #1
-->
## Upcoming Release
* Introduced various new features by upgrading code generator. Please see details [here](https://github.com/Azure/azure-powershell/blob/main/documentation/Autorest-powershell-v4-new-features.md).
@YanaXu YanaXu added the autorest v4 migration pr migrating module from generated by autorest.powershell v3 to v4 label May 14, 2026
@JunKai-v JunKai-v closed this May 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autorest v4 migration pr migrating module from generated by autorest.powershell v3 to v4

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants