Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
[assembly: System.Reflection.AssemblyCopyrightAttribute("Copyright © Microsoft")]
[assembly: System.Reflection.AssemblyProductAttribute("Microsoft Azure PowerShell")]
[assembly: System.Reflection.AssemblyTitleAttribute("Microsoft Azure PowerShell - ManagedServices")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("3.1.1")]
[assembly: System.Reflection.AssemblyVersionAttribute("3.1.1")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("3.1.2")]
[assembly: System.Reflection.AssemblyVersionAttribute("3.1.2")]
[assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)]
[assembly: System.CLSCompliantAttribute(false)]
102 changes: 4 additions & 98 deletions src/ManagedServices/ManagedServices.Autorest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,94 +38,7 @@ title: ManagedServices
module-version: 2.0.0
subject-prefix: $(service-name)

identity-correction-for-post: true
resourcegroup-append: true
nested-object-to-string: true

# For new modules, please avoid setting 3.x using the use-extension method and instead, use 4.x as the default option
use-extension:
"@autorest/powershell": "3.x"

directive:
- where:
verb: New|Get
subject: RegistrationAssignment
set:
breaking-change:
deprecated-output-properties:
- Authorization[]
- EligibleAuthorization[]
new-output-properties:
- List[Authorization]
- List[EligibleAuthorization]
deprecated-by-version: 9.0.0
deprecated-by-azversion: 15.0.0
change-effective-date: 2025/11/03
- where:
verb: New
subject: RegistrationDefinition
set:
breaking-change:
deprecated-output-properties:
- Authorization
- EligibleAuthorization
- DelegatedRoleDefinitionId[]
- JustInTimeAccessPolicyManagedByTenantApprover[]
new-output-properties:
- List[Authorization]
- List[EligibleAuthorization]
- List[DelegatedRoleDefinitionId]
- List[JustInTimeAccessPolicyManagedByTenantApprover]
deprecated-by-version: 9.0.0
deprecated-by-azversion: 15.0.0
change-effective-date: 2025/11/03
- where:
verb: Get
subject: RegistrationDefinition
set:
breaking-change:
deprecated-output-properties:
- Authorization[]
- EligibleAuthorization[]
new-output-properties:
- List[Authorization]
- List[EligibleAuthorization]
deprecated-by-version: 9.0.0
deprecated-by-azversion: 15.0.0
change-effective-date: 2025/11/03
- where:
verb: New|Get
subject: MarketplaceRegistrationDefinition
set:
breaking-change:
deprecated-output-properties:
- Authorization[]
- EligibleAuthorization[]
new-output-properties:
- List[Authorization]
- List[EligibleAuthorization]
deprecated-by-version: 9.0.0
deprecated-by-azversion: 15.0.0
change-effective-date: 2025/11/03
- where:
parameter-name: Authorization
set:
breaking-change:
old-parameter-type: Array
new-parameter-type: List
deprecated-by-version: 9.0.0
deprecated-by-azversion: 15.0.0
change-effective-date: 2025/11/03
- where:
parameter-name: EligibleAuthorization
set:
breaking-change:
old-parameter-type: Array
new-parameter-type: List
deprecated-by-version: 9.0.0
deprecated-by-azversion: 15.0.0
change-effective-date: 2025/11/03

# Remove unnecessary cmdlet.
- where:
verb: Set
Expand All @@ -139,8 +52,7 @@ directive:

# Remove variant of the cmdlet
- where:
verb: New
variant: ^Create$|^CreateViaIdentity$|^CreateViaIdentityExpanded$
variant: ^(Create|Update)(?!.*?(Expanded|JsonFilePath|JsonString))|^CreateViaIdentityExpanded$
remove: true

# Hide cmdlet
Expand All @@ -162,18 +74,12 @@ directive:
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:
# - Authorization
- EligibleApprover
- model-name: Authorization
- model-name: EligibleApprover
# Need custom that add ArgumentCompleterAttribute for JustInTimeAccessPolicyMultiFactorAuthProvider parameter.
# - EligibleAuthorization
# - model-name: EligibleAuthorization

# The function invalid for memory cmdlet.
# Custom cmdlet.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ PS C:\> {{ Add code here }}
.Inputs
Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models.IManagedServicesIdentity
.Outputs
Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models.Api20200201Preview.IMarketplaceRegistrationDefinition
Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models.IMarketplaceRegistrationDefinition
.Notes
COMPLEX PARAMETER PROPERTIES

Expand All @@ -46,7 +46,7 @@ INPUTOBJECT <IManagedServicesIdentity>: Identity Parameter
https://learn.microsoft.com/powershell/module/az.managedservices/get-azmanagedservicesmarketplacedefinition
#>
function Get-AzManagedServicesMarketplaceDefinition {
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models.Api20200201Preview.IMarketplaceRegistrationDefinition])]
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models.IMarketplaceRegistrationDefinition])]
[CmdletBinding(DefaultParameterSetName='ListWithScope', PositionalBinding=$false)]
param(
[Parameter(ParameterSetName='GetWithScope', Mandatory)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@ Create an in-memory object for Authorization.
Create an in-memory object for Authorization.

.Outputs
Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models.Api20200201Preview.Authorization
Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models.Authorization
.Link
https://learn.microsoft.com/powershell/module/Az.ManagedServices/new-AzManagedServicesAuthorizationObject
https://learn.microsoft.com/powershell/module/Az.ManagedServices/new-azmanagedservicesauthorizationobject
#>
function New-AzManagedServicesAuthorizationObject {
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models.Api20200201Preview.Authorization')]
[Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.ModelCmdletAttribute()]
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models.Authorization')]
[CmdletBinding(PositionalBinding=$false)]
Param(
[Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.ParameterBreakingChangeAttribute("DelegatedRoleDefinitionId", "15.0.0", "9.0.0", "2025/11/03", OldParamaterType="Array", NewParameterType="List")]
Expand All @@ -45,7 +46,7 @@ function New-AzManagedServicesAuthorizationObject {
)

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

if ($PSBoundParameters.ContainsKey('DelegatedRoleDefinitionId')) {
$Object.DelegatedRoleDefinitionId = $DelegatedRoleDefinitionId
Expand Down
Original file line number Diff line number Diff line change
@@ -1,43 +1,45 @@

# ----------------------------------------------------------------------------------
#
# Copyright Microsoft Corporation
# Licensed under the Apache License, Version 2.0 (the \"License\");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an \"AS IS\" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ----------------------------------------------------------------------------------
# ----------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
# is regenerated.
# ----------------------------------------------------------------------------------

<#
.Synopsis
Create a in-memory object for EligibleAuthorization
.Description
Create a in-memory object for EligibleAuthorization
<#
.Synopsis
Create an in-memory object for EligibleAuthorization.
.Description
Create an in-memory object for EligibleAuthorization.

.Outputs
Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models.Api20200201Preview.EligibleAuthorization
.Link
https://learn.microsoft.com/powershell/module/az.ManagedServices/new-AzManagedServicesEligibleAuthorizationObject
#>
.Outputs
Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models.EligibleAuthorization
.Link
https://learn.microsoft.com/powershell/module/az.ManagedServices/new-AzManagedServicesEligibleAuthorizationObject
#>
function New-AzManagedServicesEligibleAuthorizationObject {
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models.Api20200201Preview.EligibleAuthorization')]
[Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.ModelCmdletAttribute()]
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models.EligibleAuthorization')]
[CmdletBinding(PositionalBinding=$false)]
Param(
[Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.ParameterBreakingChangeAttribute("JustInTimeAccessPolicyManagedByTenantApprover", "15.0.0", "9.0.0", "2025/11/03", OldParamaterType="Array", NewParameterType="List")]
[Parameter(HelpMessage="The list of managedByTenant approvers for the eligible authorization.")]
[Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models.Api20200201Preview.IEligibleApprover[]]
[Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models.IEligibleApprover[]]
$JustInTimeAccessPolicyManagedByTenantApprover,
[Parameter(HelpMessage="The maximum access duration in ISO 8601 format for just-in-time access requests.")]
[System.TimeSpan]
$JustInTimeAccessPolicyMaximumActivationDuration,
[Parameter(HelpMessage="The multi-factor authorization provider to be used for just-in-time access requests.")]
[Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Support.MultiFactorAuthProvider]
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Support.MultiFactorAuthProvider])]
[Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.PSArgumentCompleterAttribute("Azure", "None")]
[string]
$JustInTimeAccessPolicyMultiFactorAuthProvider,
[Parameter(Mandatory, HelpMessage="The identifier of the Azure Active Directory principal.")]
[string]
Expand All @@ -51,7 +53,7 @@
)

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

$Object.JustInTimeAccessPolicyManagedByTenantApprover = $JustInTimeAccessPolicyManagedByTenantApprover

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@

# ----------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
# is regenerated.
# ----------------------------------------------------------------------------------

<#
.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(

Comment on lines +28 to +33
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.
[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
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@ Create an in-memory object for EligibleApprover.
Create an in-memory object for EligibleApprover.

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

Expand All @@ -39,7 +40,7 @@ function New-AzManagedServicesEligibleApproverObject {
)

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

if ($PSBoundParameters.ContainsKey('PrincipalId')) {
$Object.PrincipalId = $PrincipalId
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
Module Name: Az.ManagedServices
Module Guid: 61496bfd-6bc7-48fb-8803-05ad306368f3
Module Guid: df85bc10-3067-4698-954b-7c4948d51456
Download Help Link: https://learn.microsoft.com/powershell/module/az.managedservices
Help Version: 1.0.0.0
Locale: en-US
Expand All @@ -21,23 +21,26 @@ Gets the registration definition details.
Get the marketplace registration definition for the marketplace identifier.

### [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.

### [New-AzManagedServicesEligibleApproverObject](New-AzManagedServicesEligibleApproverObject.md)
Create an in-memory object for EligibleApprover.

### [New-AzManagedServicesEligibleAuthorizationObject](New-AzManagedServicesEligibleAuthorizationObject.md)
Create a in-memory object for EligibleAuthorization
Create an in-memory object for EligibleAuthorization.

### [Remove-AzManagedServicesAssignment](Remove-AzManagedServicesAssignment.md)
Deletes the specified registration assignment.

### [Remove-AzManagedServicesDefinition](Remove-AzManagedServicesDefinition.md)
Deletes the registration definition.

### [Update-AzManagedServicesDefinition](Update-AzManagedServicesDefinition.md)
Update a registration definition.

Loading
Loading