Skip to content

[PS] Migrate ManagedServices module to autorest v4#27929

Open
JoyerJin wants to merge 9 commits intomainfrom
joyer/managedservice-migrate-v4
Open

[PS] Migrate ManagedServices module to autorest v4#27929
JoyerJin wants to merge 9 commits intomainfrom
joyer/managedservice-migrate-v4

Conversation

@JoyerJin
Copy link
Copy Markdown
Contributor

@JoyerJin JoyerJin commented Jun 11, 2025

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 June 11, 2025 08:46
@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.

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 migrates the ManagedServices module to autorest v4 and updates associated cmdlets and documentation. The changes standardize model type references from the preview namespace to the general namespace, update sample examples and URLs, and adjust documentation to reflect new cmdlet variants.

  • Updated generate-info.json GUID
  • Revised documentation and sample examples to align with autorest v4 changes (e.g., model types and cmdlet syntax)
  • Adjusted custom cmdlet scripts with updated attributes and output types

Reviewed Changes

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

Show a summary per file
File Description
src/ManagedServices/ManagedServices.Autorest/generate-info.json Updated the generate_Id value
src/ManagedServices/ManagedServices.Autorest/examples/Update-AzManagedServicesDefinition.md Updated sample example for updating a registration definition
src/ManagedServices/ManagedServices.Autorest/docs/Update-AzManagedServicesDefinition.md Added new documentation for the Update cmdlet
src/ManagedServices/ManagedServices.Autorest/docs/Remove-AzManagedServicesDefinition.md Minor documentation fixes
src/ManagedServices/ManagedServices.Autorest/docs/Remove-AzManagedServicesAssignment.md Minor documentation fixes
src/ManagedServices/ManagedServices.Autorest/docs/New-AzManagedServicesEligibleAuthorizationObject.md Documentation updates and parameter type change for multi-factor auth provider
src/ManagedServices/ManagedServices.Autorest/docs/New-AzManagedServicesEligibleApproverObject.md Updated URL and model type reference
src/ManagedServices/ManagedServices.Autorest/docs/New-AzManagedServicesDefinition.md Updated documentation with new cmdlet variants and updated output types
src/ManagedServices/ManagedServices.Autorest/docs/New-AzManagedServicesAuthorizationObject.md Adjusted model type references
src/ManagedServices/ManagedServices.Autorest/docs/New-AzManagedServicesAssignment.md Added new documentation for assignment cmdlet with Json variants
src/ManagedServices/ManagedServices.Autorest/docs/Get-AzManagedServicesMarketplaceDefinition.md Updated output type reference
src/ManagedServices/ManagedServices.Autorest/docs/Get-AzManagedServicesDefinition.md Updated output type reference
src/ManagedServices/ManagedServices.Autorest/docs/Get-AzManagedServicesAssignment.md Updated output type reference
src/ManagedServices/ManagedServices.Autorest/docs/Az.ManagedServices.md Updated module metadata and cmdlet descriptions
src/ManagedServices/ManagedServices.Autorest/custom/autogen-model-cmdlets/New-AzManagedServicesEligibleApproverObject.ps1 Updated model type and documentation link
src/ManagedServices/ManagedServices.Autorest/custom/autogen-model-cmdlets/New-AzManagedServicesAuthorizationObject.ps1 Updated model type and documentation link
src/ManagedServices/ManagedServices.Autorest/custom/New-AzManagedServicesEligibleAuthorizationObject.ps1 Updated header, model reference, and parameter attribute for multi-factor auth provider
src/ManagedServices/ManagedServices.Autorest/custom/Get-AzManagedServicesMarketplaceDefinition.ps1 Updated output type reference
src/ManagedServices/ManagedServices.Autorest/README.md Updated directives, regex, and model-cmdlet mapping
src/ManagedServices/ManagedServices.Autorest/Properties/AssemblyInfo.cs Updated assembly GUID and version information
Comments suppressed due to low confidence (1)

src/ManagedServices/ManagedServices.Autorest/docs/New-AzManagedServicesEligibleAuthorizationObject.md:97

  • Ensure that changing the parameter type for 'JustInTimeAccessPolicyMultiFactorAuthProvider' from a dedicated enum ('MultiFactorAuthProvider') to 'System.String' is intentional and that appropriate validation is implemented where this parameter is used.
Type: System.String

@JoyerJin
Copy link
Copy Markdown
Contributor Author

breaking change from 'System.String[]' to 'System.Collections.Generic.List`1[System.String]'

@github-actions
Copy link
Copy Markdown

‼️ DO NOT MERGE THIS PR ‼️
This PR was labeled "Do Not Merge" because it contains code change that cannot be merged. Please contact the reviewer for more information.

@JoyerJin JoyerJin added Contains Breaking Change This PR contains breaking change and removed Do Not Merge 🚫 labels Jun 13, 2025
@github-actions
Copy link
Copy Markdown

To the author of the pull request,
This PR was labeled "Breaking Change Release" because it contains breaking changes.

  • According to our policy, breaking changes can only take place during major release and they must be preannounced.
  • Please follow our guide on the detailed steps.
  • Required: Please fill in the task below to facilitate our contact,you will receive notifications related to breaking changes.

@vidai-msft vidai-msft marked this pull request as draft June 16, 2025 06:51
@JoyerJin JoyerJin marked this pull request as ready for review August 6, 2025 07:11
@isra-fel isra-fel added the autorest v4 migration pr migrating module from generated by autorest.powershell v3 to v4 label Oct 2, 2025
@Pan-Qi
Copy link
Copy Markdown
Contributor

Pan-Qi commented Jan 9, 2026

/azp run

@azure-pipelines
Copy link
Copy Markdown
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

@isra-fel isra-fel added this to the Az 16.0.0 (TBD) milestone Jan 28, 2026
Copilot AI review requested due to automatic review settings February 10, 2026 08:58
@JunKai-v
Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines
Copy link
Copy Markdown
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

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 38 out of 38 changed files in this pull request and generated 7 comments.

Comment on lines +40 to +43
$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"
```
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

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

Typo in example variable name: permantAuth should be permanentAuth for clarity/readability.

Copilot uses AI. Check for mistakes.
Comment on lines +28 to +33
function New-AzManagedServicesAuthorizationObject {
[Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.ModelCmdletAttribute()]
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models.Authorization')]
[CmdletBinding(PositionalBinding=$false)]
Param(

Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

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

This script defines New-AzManagedServicesAuthorizationObject, but the repo already has the same function name at src/ManagedServices/ManagedServices.Autorest/custom/New-AzManagedServicesAuthorizationObject.ps1. Because Az.ManagedServices.custom.psm1 dot-sources all *.ps1 under custom/ recursively, having both files will lead to non-deterministic function redefinition/overrides at import time. Keep only one implementation (either remove this autogen file or remove/rename the other one), and ensure the module loads a single, authoritative definition.

Copilot uses AI. Check for mistakes.
Comment on lines +17 to +32
Describe 'Update-AzManagedServicesDefinition' {
It 'UpdateExpanded' -skip {
{ throw [System.NotImplementedException] } | Should -Not -Throw
}

It 'Update' -skip {
{ throw [System.NotImplementedException] } | Should -Not -Throw
}

It 'UpdateViaIdentityExpanded' -skip {
{ throw [System.NotImplementedException] } | Should -Not -Throw
}

It 'UpdateViaIdentity' -skip {
{ throw [System.NotImplementedException] } | Should -Not -Throw
}
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

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

All tests in this new file are marked -skip and only assert that a NotImplementedException is not thrown, so this adds no effective coverage for the new Update-AzManagedServicesDefinition cmdlet/parameter sets. Replace the placeholder tests with real Pester tests (record/playback or mocking) that validate at least one successful update flow and one error/validation scenario.

Copilot uses AI. Check for mistakes.
{
$loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1'
if (-Not (Test-Path -Path $loadEnvPath)) {
$loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1'
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

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

This fallback uses a Windows-style relative path ('..\loadEnv.ps1'). If these Pester tests are expected to run cross-platform, prefer Join-Path $PSScriptRoot '..' | Join-Path -ChildPath 'loadEnv.ps1' (or equivalent) to avoid hardcoded path separators.

Suggested change
$loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1'
$parentPath = Join-Path $PSScriptRoot '..'
$loadEnvPath = Join-Path $parentPath 'loadEnv.ps1'

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

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

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

The new changelog entry is too generic for users ("various new features") and doesn't describe the concrete user-facing changes introduced by the v4 migration (for example: new cmdlets like Update-AzManagedServicesDefinition, new JsonString/JsonFilePath parameter sets, and any behavior/type changes surfaced to users). Please replace it with specific, user-impacting bullets (and include issue references if applicable).

Suggested change
* 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).
* Migrated the ManagedServices module to use the AutoRest PowerShell v4 code generator.
- Existing cmdlets and parameters continue to work; no script changes are required for basic scenarios.
* Added 'Update-AzManagedServicesDefinition' cmdlet to update existing managed services definitions.
* Added JsonString and JsonFilePath parameter sets to 'New-AzManagedServicesAssignment' and 'New-AzManagedServicesDefinition'.
- Users can now provide definition and assignment metadata directly as JSON text or from a JSON file path.
* Improved type information and validation for managed services assignment and definition parameters to surface clearer error messages when values are invalid.

Copilot uses AI. Check for mistakes.
Comment on lines +40 to +42
$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"
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

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

Typo in example variable name: permantAuth should be permanentAuth for clarity/readability.

Copilot uses AI. Check for mistakes.
Comment on lines +3 to +5
$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"
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

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

Typo in example variable name: permantAuth should be permanentAuth for clarity/readability.

Copilot uses AI. Check for mistakes.
@JunKai-v JunKai-v requested a review from VeryEarly March 26, 2026 04:07
@NoriZC
Copy link
Copy Markdown
Contributor

NoriZC commented Mar 27, 2026

/azp run

@azure-pipelines
Copy link
Copy Markdown
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

Copilot AI review requested due to automatic review settings April 7, 2026 08:00
@JunKai-v
Copy link
Copy Markdown
Contributor

JunKai-v commented Apr 7, 2026

/azp run

@azure-pipelines
Copy link
Copy Markdown
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

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 38 out of 38 changed files in this pull request and generated 13 comments.

Comment on lines +17 to +66
<#
.Synopsis
Create an in-memory object for Authorization.
.Description
Create an in-memory object for Authorization.

.Outputs
Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models.Authorization
.Link
https://learn.microsoft.com/powershell/module/Az.ManagedServices/new-azmanagedservicesauthorizationobject
#>
function New-AzManagedServicesAuthorizationObject {
[Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.ModelCmdletAttribute()]
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models.Authorization')]
[CmdletBinding(PositionalBinding=$false)]
Param(

[Parameter(HelpMessage="The delegatedRoleDefinitionIds field is required when the roleDefinitionId refers to the User Access Administrator Role. It is the list of role definition ids which define all the permissions that the user in the authorization can assign to other principals.")]
[string[]]
$DelegatedRoleDefinitionId,
[Parameter(Mandatory, HelpMessage="The identifier of the Azure Active Directory principal.")]
[string]
$PrincipalId,
[Parameter(HelpMessage="The display name of the Azure Active Directory principal.")]
[string]
$PrincipalIdDisplayName,
[Parameter(Mandatory, HelpMessage="The identifier of the Azure built-in role that defines the permissions that the Azure Active Directory principal will have on the projected scope.")]
[string]
$RoleDefinitionId
)

process {
$Object = [Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models.Authorization]::New()

if ($PSBoundParameters.ContainsKey('DelegatedRoleDefinitionId')) {
$Object.DelegatedRoleDefinitionId = $DelegatedRoleDefinitionId
}
if ($PSBoundParameters.ContainsKey('PrincipalId')) {
$Object.PrincipalId = $PrincipalId
}
if ($PSBoundParameters.ContainsKey('PrincipalIdDisplayName')) {
$Object.PrincipalIdDisplayName = $PrincipalIdDisplayName
}
if ($PSBoundParameters.ContainsKey('RoleDefinitionId')) {
$Object.RoleDefinitionId = $RoleDefinitionId
}
return $Object
}
}

Copy link

Copilot AI Apr 7, 2026

Choose a reason for hiding this comment

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

This file defines New-AzManagedServicesAuthorizationObject, but the same function is also defined in custom/New-AzManagedServicesAuthorizationObject.ps1. Since custom/Az.ManagedServices.custom.psm1 dot-sources all *.ps1 under custom/ recursively, the exported implementation becomes dependent on filesystem enumeration order (non-deterministic). In practice this can drop behavior present only in one definition (e.g., the ParameterBreakingChangeAttribute on DelegatedRoleDefinitionId exists in the other file). Remove one of the duplicate definitions (or stop dot-sourcing one of the paths) so there is exactly one source of truth for the cmdlet.

Suggested change
<#
.Synopsis
Create an in-memory object for Authorization.
.Description
Create an in-memory object for Authorization.
.Outputs
Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models.Authorization
.Link
https://learn.microsoft.com/powershell/module/Az.ManagedServices/new-azmanagedservicesauthorizationobject
#>
function New-AzManagedServicesAuthorizationObject {
[Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.ModelCmdletAttribute()]
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models.Authorization')]
[CmdletBinding(PositionalBinding=$false)]
Param(
[Parameter(HelpMessage="The delegatedRoleDefinitionIds field is required when the roleDefinitionId refers to the User Access Administrator Role. It is the list of role definition ids which define all the permissions that the user in the authorization can assign to other principals.")]
[string[]]
$DelegatedRoleDefinitionId,
[Parameter(Mandatory, HelpMessage="The identifier of the Azure Active Directory principal.")]
[string]
$PrincipalId,
[Parameter(HelpMessage="The display name of the Azure Active Directory principal.")]
[string]
$PrincipalIdDisplayName,
[Parameter(Mandatory, HelpMessage="The identifier of the Azure built-in role that defines the permissions that the Azure Active Directory principal will have on the projected scope.")]
[string]
$RoleDefinitionId
)
process {
$Object = [Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models.Authorization]::New()
if ($PSBoundParameters.ContainsKey('DelegatedRoleDefinitionId')) {
$Object.DelegatedRoleDefinitionId = $DelegatedRoleDefinitionId
}
if ($PSBoundParameters.ContainsKey('PrincipalId')) {
$Object.PrincipalId = $PrincipalId
}
if ($PSBoundParameters.ContainsKey('PrincipalIdDisplayName')) {
$Object.PrincipalIdDisplayName = $PrincipalIdDisplayName
}
if ($PSBoundParameters.ContainsKey('RoleDefinitionId')) {
$Object.RoleDefinitionId = $RoleDefinitionId
}
return $Object
}
}
# Intentionally left without a cmdlet definition.
# The single supported implementation of New-AzManagedServicesAuthorizationObject
# lives in custom/New-AzManagedServicesAuthorizationObject.ps1.
# Removing the duplicate definition from this autogenerated path avoids
# non-deterministic function override behavior when custom/*.ps1 files are
# dot-sourced recursively.

Copilot uses AI. Check for mistakes.
- model-cmdlet:
# - Authorization
- EligibleApprover
- model-name: Authorization
Copy link

Copilot AI Apr 7, 2026

Choose a reason for hiding this comment

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

model-cmdlet generation includes Authorization, which is producing an auto-generated New-AzManagedServicesAuthorizationObject under custom/autogen-model-cmdlets/ while a hand-maintained version already exists in custom/. Because the module dot-sources all scripts recursively, this results in two competing implementations and non-deterministic exports. Either remove Authorization from model-cmdlet generation or delete the hand-maintained cmdlet and move any custom attributes/behavior into the generated one so only one implementation is loaded.

Suggested change
- model-name: Authorization
# Do not generate Authorization because a hand-maintained
# New-AzManagedServicesAuthorizationObject already exists under custom/.
# Generating it here would create a duplicate implementation under
# custom/autogen-model-cmdlets/ and lead to non-deterministic exports.

Copilot uses AI. Check for mistakes.
Comment on lines 132 to 133
# Remove variant of the cmdlet
- where:
Copy link

Copilot AI Apr 7, 2026

Choose a reason for hiding this comment

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

The variant-removal directive currently filters only on variant: and will apply across all cmdlets/verbs in this module. To avoid unintentionally removing parameter sets/variants from unrelated cmdlets (now or in future), constrain the where: clause (e.g., include the intended verb and/or subject) so it only targets the New/Update cmdlets you mean to trim.

Suggested change
# Remove variant of the cmdlet
- where:
# Remove unsupported Create and Update variants only for New and Update cmdlets.
# Constraining by verb prevents this module-wide variant filter from trimming unrelated cmdlets.
- where:
verb: New|Update

Copilot uses AI. Check for mistakes.
Comment on lines 149 to 157
# Set default vaule for scope parameter
- where:
parameter-name: Scope
set:
default:
script: '"subscriptions/" + (Get-AzContext).Subscription.Id'

# The regex(^/(?<scope>[^/]+)/) mathch failed because the scope inlcude '/' character.
# Replace regex to fixed it.
- from: source-file-csharp
where: $
transform: $ = $.replace(/global::System.Text.RegularExpressions.Regex\(\"\^\/\(\?\<scope\>\[\^\/\]\+\)/g, 'global::System.Text.RegularExpressions.Regex("^/(?<scope>.+)');

# Generate memory object as parameter of the cmelet.
- model-cmdlet:
Copy link

Copilot AI Apr 7, 2026

Choose a reason for hiding this comment

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

Spelling/grammar in nearby comments: "vaule" should be "value" and "cmelet" should be "cmdlet". These comments are user-facing for maintainers and get copied around in module templates, so it’s worth fixing the typos.

Copilot uses AI. Check for mistakes.
Comment on lines 59 to 64
# Script files (.ps1) that are run in the caller's environment prior to importing this module.
# ScriptsToProcess = @()
ScriptsToProcess = @()

# Type files (.ps1xml) to be loaded when importing this module
# TypesToProcess = @()
TypesToProcess = @()

Copy link

Copilot AI Apr 7, 2026

Choose a reason for hiding this comment

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

The manifest now explicitly sets ScriptsToProcess = @() and TypesToProcess = @(). In this repo, these entries are typically left commented out unless needed (e.g., src/Accounts/Accounts/Az.Accounts.psd1:85-88). Consider reverting these to commented lines to match the common module-manifest pattern and avoid unnecessary diff/noise.

Copilot uses AI. Check for mistakes.
Comment on lines +38 to +43
### Example 1: Update Azure Lighthouse registration definition object with permanent authorization
```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"
```
Copy link

Copilot AI Apr 7, 2026

Choose a reason for hiding this comment

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

$permantAuth in the example appears to be a typo (should be something like $permanentAuth). Since this file is user-facing example documentation, please fix the variable name to avoid propagating the typo into customer scripts.

Copilot uses AI. Check for mistakes.
Comment on lines +40 to +42
$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"
Copy link

Copilot AI Apr 7, 2026

Choose a reason for hiding this comment

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

$permantAuth in this example is a typo (likely meant $permanentAuth). Please fix the variable name so the docs example is copy/paste friendly and doesn’t spread the misspelling to user scripts.

Suggested change
$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"
$permanentAuth = 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 $permanentAuth -Description "Test definition desc" -Scope "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"

Copilot uses AI. Check for mistakes.
Comment on lines 10 to 12
## SYNOPSIS
Creates or updates a registration definition.
Create a registration definition.

Copy link

Copilot AI Apr 7, 2026

Choose a reason for hiding this comment

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

The docs here say "Create a registration definition", but the cmdlet is a CreateOrUpdate (PUT) operation (generated C# description is "Creates or updates a registration definition"). Please update SYNOPSIS/DESCRIPTION to reflect that it can update an existing definition, not only create.

Copilot uses AI. Check for mistakes.
Comment on lines 10 to 12
## SYNOPSIS
Creates or updates a registration assignment.
Create a registration assignment.

Copy link

Copilot AI Apr 7, 2026

Choose a reason for hiding this comment

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

The docs here say "Create a registration assignment", but the cmdlet maps to the ARM CreateOrUpdate (PUT) operation and can update an existing assignment. Please adjust SYNOPSIS/DESCRIPTION to "Creates or updates" to match the actual behavior.

Copilot uses AI. Check for mistakes.
Comment on lines 23 to 31
### [New-AzManagedServicesAssignment](New-AzManagedServicesAssignment.md)
Creates or updates a registration assignment.
Create a registration assignment.

### [New-AzManagedServicesAuthorizationObject](New-AzManagedServicesAuthorizationObject.md)
Create an in-memory object for Authorization.

### [New-AzManagedServicesDefinition](New-AzManagedServicesDefinition.md)
Creates or updates a registration definition.
Create a registration definition.

Copy link

Copilot AI Apr 7, 2026

Choose a reason for hiding this comment

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

This cmdlet index lists New-AzManagedServicesAssignment/New-AzManagedServicesDefinition as "Create ...", but both cmdlets are CreateOrUpdate (PUT) operations. Update these one-line summaries to "Creates or updates ..." so the module landing page matches actual cmdlet behavior.

Copilot uses AI. Check for mistakes.
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 Contains Breaking Change This PR contains breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants