diff --git a/src/ManagedServices/ManagedServices.Test/ScenarioTests/ManagedServicesTests.ps1 b/src/ManagedServices/ManagedServices.Test/ScenarioTests/ManagedServicesTests.ps1 index 14e3b1b0654c..cf393d315fcc 100644 --- a/src/ManagedServices/ManagedServices.Test/ScenarioTests/ManagedServicesTests.ps1 +++ b/src/ManagedServices/ManagedServices.Test/ScenarioTests/ManagedServicesTests.ps1 @@ -17,140 +17,59 @@ Create, update, and delete registration assignments and registration definitions #> -function New-AzManagedServicesAssignmentWithId -{ - [CmdletBinding()] - param( - [string] [Parameter()] $Scope, - [string] [Parameter()] $RegistrationDefinitionResourceId, - [Guid] [Parameter()] $RegistrationAssignmentId - ) - - $profile = [Microsoft.Azure.Commands.Common.Authentication.Abstractions.AzureRmProfileProvider]::Instance.Profile - $cmdlet = New-Object -TypeName Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Commands.NewAzureRmManagedServicesAssignment - $cmdlet.DefaultProfile = $profile - $cmdlet.CommandRuntime = $PSCmdlet.CommandRuntime - - if (-not ([string]::IsNullOrEmpty($Scope))) - { - $cmdlet.Scope = $Scope - } - - if (-not ([string]::IsNullOrEmpty($RegistrationDefinitionResourceId))) - { - $cmdlet.RegistrationDefinitionResourceId = $RegistrationDefinitionResourceId - } - - if ($RegistrationAssignmentId -ne $null -and $RegistrationAssignmentId -ne [System.Guid]::Empty) - { - $cmdlet.RegistrationAssignmentId = $RegistrationAssignmentId - } - - $cmdlet.ExecuteCmdlet() -} - -function New-AzManagedServicesDefinitionWithId +function Test-ManagedServices_CRUD { - [CmdletBinding()] - param( - [string] [Parameter()] $Name, - [string] [Parameter()] $ManagedByTenantId, - [string] [Parameter()] $PrincipalId, - [string] [Parameter()] $RoleDefinitionId, - [string] [Parameter()] $Description, - [Guid] [Parameter()] $RegistrationDefinitionId - ) - - $profile = [Microsoft.Azure.Commands.Common.Authentication.Abstractions.AzureRmProfileProvider]::Instance.Profile - $cmdlet = New-Object -TypeName Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Commands.NewAzureRmManagedServicesDefinition - $cmdlet.DefaultProfile = $profile - $cmdlet.CommandRuntime = $PSCmdlet.CommandRuntime - - if (-not ([string]::IsNullOrEmpty($Description))) + $roleDefinitionId = "acdd72a7-3385-48ef-bd42-f606fba81ae7" + $managedByTenantId = "bab3375b-6197-4a15-a44b-16c41faa91d7" + $principalId = "d6f6c88a-5b7a-455e-ba40-ce146d4d3671" + $subscriptionId = "002b3477-bfbf-4402-b377-6003168b75d3" + $displayName = "Resource display name" + $assignmentId = "8af8768c-73c2-4993-86ae-7a45c9b232c6" + $definitionId = "1ccdb215-959a-48b9-bd7c-0584d461ea6c" + + #put definition + $definition = New-AzManagedServicesDefinition -ManagedByTenantId $managedByTenantId -RoleDefinitionId $roleDefinitionId -PrincipalId $principalId -DisplayName $displayName -Name $definitionId + + Assert-AreEqual $definitionId $definition.Name + Assert-AreEqual $displayName $definition.Properties.DisplayName + Assert-AreEqual $managedByTenantId $definition.Properties.ManagedByTenantId + Assert-AreEqual $roleDefinitionId $definition.Properties.Authorization[0].RoleDefinitionId + Assert-AreEqual $principalId $definition.Properties.Authorization[0].PrincipalId + + # get definition + $retrievedDefinition = Get-AzManagedServicesDefinition -Name $definitionId + Assert-NotNull $retrievedDefinition + Assert-AreEqual $definition.Id $retrievedDefinition.Id + + #put assignment + $assignment = New-AzManagedServicesAssignment ` + -RegistrationDefinitionId $definition.Id ` + -Name $assignmentId + Assert-NotNull $assignment + + #get assignment + $retrievedAssignment = Get-AzManagedServicesAssignment -Name $assignmentId -ExpandRegistrationDefinition + Assert-NotNull $retrievedAssignment + Assert-AreEqual $assignment.Id $retrievedAssignment.Id + Assert-AreEqual $definition.Id $retrievedAssignment.Properties.RegistrationDefinitionId + + #remove assignment + Remove-AzManagedServicesAssignment -Name $assignmentId + + #remove definition + Remove-AzManagedServicesDefinition -Name $definitionId + + #list assignments + $assignments = Get-AzManagedServicesAssignment + Foreach($assignment in $assignments) { - $cmdlet.Description = $Description + Assert-AreNotEqual($assignmentId, $assignment.Name) } - if (-not ([string]::IsNullOrEmpty($Name))) + #list definitions + $definitions = Get-AzManagedServicesDefinition + Foreach($definition in $definitions) { - $cmdlet.Name = $Name + Assert-AreNotEqual($assignmentId, $assignment.Name) } - - if (-not ([string]::IsNullOrEmpty($ManagedByTenantId))) - { - $cmdlet.ManagedByTenantId = $ManagedByTenantId - } - - if (-not ([string]::IsNullOrEmpty($PrincipalId))) - { - $cmdlet.PrincipalId = $PrincipalId - } - - if (-not ([string]::IsNullOrEmpty($RoleDefinitionId))) - { - $cmdlet.RoleDefinitionId = $RoleDefinitionId - } - - if ($RegistrationDefinitionId -ne $null -and $RegistrationDefinitionId -ne [System.Guid]::Empty) - { - $cmdlet.RegistrationDefinitionId = $RegistrationDefinitionId - } - - $cmdlet.ExecuteCmdlet() -} - -function Test-ManagedServices_CRUD -{ - $roleDefinitionId = "acdd72a7-3385-48ef-bd42-f606fba81ae7"; - $managedByTenantId = "bab3375b-6197-4a15-a44b-16c41faa91d7"; - $principalId = "d6f6c88a-5b7a-455e-ba40-ce146d4d3671"; - $subscriptionId = "002b3477-bfbf-4402-b377-6003168b75d3" - $name = getAssetName - $assignmentId = "8af8768c-73c2-4993-86ae-7a45c9b232c6"; - $definitionId = "1ccdb215-959a-48b9-bd7c-0584d461ea6c" - - #put def - $definition = New-AzManagedServicesDefinitionWithId -ManagedByTenantId $managedByTenantId -RoleDefinitionId $roleDefinitionId -PrincipalId $principalId -Name $name -RegistrationDefinitionId $definitionId - - Assert-AreEqual $name $definition.Properties.Name - Assert-AreEqual $managedByTenantId $definition.Properties.ManagedByTenantId - Assert-AreEqual $roleDefinitionId $definition.Properties.Authorization[0].RoleDefinitionId - Assert-AreEqual $principalId $definition.Properties.Authorization[0].PrincipalId - - # get def - $getDef = Get-AzManagedServicesDefinition -Name $definitionId - Assert-NotNull $getDef - Assert-AreEqual $definition.Id $getDef.Id - - #put assignment - $assignment = New-AzManagedServicesAssignmentWithId ` - -RegistrationDefinitionResourceId $definition.Id ` - -RegistrationAssignmentId $assignmentId - Assert-NotNull $assignment - - #get assignment - $getAssignment = Get-AzManagedServicesAssignment -Id $assignmentId -ExpandRegistrationDefinition - Assert-NotNull $getAssignment - Assert-AreEqual $assignment.Id $getAssignment.Id - Assert-AreEqual $definition.Id $getAssignment.Properties.RegistrationDefinitionId - - #remove assignment - Remove-AzManagedServicesAssignment -Id $assignmentId - - #remove definition - Remove-AzManagedServicesDefinition -Id $definitionId - - #list assignments - $assignments = Get-AzManagedServicesAssignment - Foreach($assignment in $assignments) - { - Assert-AreNotEqual($assignmentId, $assignment.Name) - } - - #list definitions - $definitions = Get-AzManagedServicesDefinition - Foreach($definition in $definitions) - { - Assert-AreNotEqual($definitionId, $definition.Name) - } } \ No newline at end of file diff --git a/src/ManagedServices/ManagedServices.Test/ScenarioTests/TestController.cs b/src/ManagedServices/ManagedServices.Test/ScenarioTests/TestController.cs index 4b618c744d64..7bcb79242eab 100644 --- a/src/ManagedServices/ManagedServices.Test/ScenarioTests/TestController.cs +++ b/src/ManagedServices/ManagedServices.Test/ScenarioTests/TestController.cs @@ -12,20 +12,19 @@ // limitations under the License. // ---------------------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.IO; -using System.Linq; using Microsoft.Azure.Commands.Common.Authentication; -using Microsoft.Azure.Management.Storage.Version2017_10_01; +using Microsoft.Azure.Management.Internal.Resources; +using Microsoft.Azure.Management.ManagedServices; using Microsoft.Azure.Test.HttpRecorder; using Microsoft.Rest.ClientRuntime.Azure.TestFramework; using Microsoft.WindowsAzure.Commands.ScenarioTest; using Microsoft.WindowsAzure.Commands.Test.Utilities.Common; +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Linq; using TestEnvironmentFactory = Microsoft.Rest.ClientRuntime.Azure.TestFramework.TestEnvironmentFactory; -using Microsoft.Azure.Management.Internal.Resources; -using Microsoft.Azure.Management.ManagedServices; namespace Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Test.ScenarioTests { diff --git a/src/ManagedServices/ManagedServices.Test/SessionRecords/Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Test.ScenarioTests.ManagedServicesTests/ManagedServices_CRUD.json b/src/ManagedServices/ManagedServices.Test/SessionRecords/Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Test.ScenarioTests.ManagedServicesTests/ManagedServices_CRUD.json index 8273324532b7..b4987294ce8e 100644 --- a/src/ManagedServices/ManagedServices.Test/SessionRecords/Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Test.ScenarioTests.ManagedServicesTests/ManagedServices_CRUD.json +++ b/src/ManagedServices/ManagedServices.Test/SessionRecords/Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Test.ScenarioTests.ManagedServicesTests/ManagedServices_CRUD.json @@ -4,7 +4,7 @@ "RequestUri": "//subscriptions/002b3477-bfbf-4402-b377-6003168b75d3/providers/Microsoft.ManagedServices/registrationDefinitions/1ccdb215-959a-48b9-bd7c-0584d461ea6c?api-version=2019-06-01", "EncodedRequestUri": "Ly9zdWJzY3JpcHRpb25zLzAwMmIzNDc3LWJmYmYtNDQwMi1iMzc3LTYwMDMxNjhiNzVkMy9wcm92aWRlcnMvTWljcm9zb2Z0Lk1hbmFnZWRTZXJ2aWNlcy9yZWdpc3RyYXRpb25EZWZpbml0aW9ucy8xY2NkYjIxNS05NTlhLTQ4YjktYmQ3Yy0wNTg0ZDQ2MWVhNmM/YXBpLXZlcnNpb249MjAxOS0wNi0wMQ==", "RequestMethod": "PUT", - "RequestBody": "{\r\n \"properties\": {\r\n \"authorizations\": [\r\n {\r\n \"principalId\": \"d6f6c88a-5b7a-455e-ba40-ce146d4d3671\",\r\n \"roleDefinitionId\": \"acdd72a7-3385-48ef-bd42-f606fba81ae7\"\r\n }\r\n ],\r\n \"registrationDefinitionName\": \"ps4125\",\r\n \"managedByTenantId\": \"bab3375b-6197-4a15-a44b-16c41faa91d7\"\r\n }\r\n}", + "RequestBody": "{\r\n \"properties\": {\r\n \"authorizations\": [\r\n {\r\n \"principalId\": \"d6f6c88a-5b7a-455e-ba40-ce146d4d3671\",\r\n \"roleDefinitionId\": \"acdd72a7-3385-48ef-bd42-f606fba81ae7\"\r\n }\r\n ],\r\n \"registrationDefinitionName\": \"Resource display name\",\r\n \"managedByTenantId\": \"bab3375b-6197-4a15-a44b-16c41faa91d7\"\r\n }\r\n}", "RequestHeaders": { "x-ms-client-request-id": [ "d76ebdf0-ae7f-40a3-b5a7-2bd5ce00075a" @@ -63,7 +63,7 @@ "-1" ] }, - "ResponseBody": "{\r\n \"properties\": {\r\n \"registrationDefinitionName\": \"ps4125\",\r\n \"managedByTenantId\": \"bab3375b-6197-4a15-a44b-16c41faa91d7\",\r\n \"authorizations\": [\r\n {\r\n \"principalId\": \"d6f6c88a-5b7a-455e-ba40-ce146d4d3671\",\r\n \"roleDefinitionId\": \"acdd72a7-3385-48ef-bd42-f606fba81ae7\"\r\n }\r\n ],\r\n \"provisioningState\": \"Succeeded\",\r\n \"managedByTenantName\": \"Default Directory\"\r\n },\r\n \"id\": \"/subscriptions/002b3477-bfbf-4402-b377-6003168b75d3/providers/Microsoft.ManagedServices/registrationDefinitions/1ccdb215-959a-48b9-bd7c-0584d461ea6c\",\r\n \"type\": \"Microsoft.ManagedServices/registrationDefinitions\",\r\n \"name\": \"1ccdb215-959a-48b9-bd7c-0584d461ea6c\"\r\n}", + "ResponseBody": "{\r\n \"properties\": {\r\n \"registrationDefinitionName\": \"Resource display name\",\r\n \"managedByTenantId\": \"bab3375b-6197-4a15-a44b-16c41faa91d7\",\r\n \"authorizations\": [\r\n {\r\n \"principalId\": \"d6f6c88a-5b7a-455e-ba40-ce146d4d3671\",\r\n \"roleDefinitionId\": \"acdd72a7-3385-48ef-bd42-f606fba81ae7\"\r\n }\r\n ],\r\n \"provisioningState\": \"Succeeded\",\r\n \"managedByTenantName\": \"Default Directory\"\r\n },\r\n \"id\": \"/subscriptions/002b3477-bfbf-4402-b377-6003168b75d3/providers/Microsoft.ManagedServices/registrationDefinitions/1ccdb215-959a-48b9-bd7c-0584d461ea6c\",\r\n \"type\": \"Microsoft.ManagedServices/registrationDefinitions\",\r\n \"name\": \"1ccdb215-959a-48b9-bd7c-0584d461ea6c\"\r\n}", "StatusCode": 201 }, { @@ -126,7 +126,7 @@ "-1" ] }, - "ResponseBody": "{\r\n \"properties\": {\r\n \"registrationDefinitionName\": \"ps4125\",\r\n \"managedByTenantId\": \"bab3375b-6197-4a15-a44b-16c41faa91d7\",\r\n \"authorizations\": [\r\n {\r\n \"principalId\": \"d6f6c88a-5b7a-455e-ba40-ce146d4d3671\",\r\n \"roleDefinitionId\": \"acdd72a7-3385-48ef-bd42-f606fba81ae7\"\r\n }\r\n ],\r\n \"provisioningState\": \"Succeeded\",\r\n \"managedByTenantName\": \"Default Directory\"\r\n },\r\n \"id\": \"/subscriptions/002b3477-bfbf-4402-b377-6003168b75d3/providers/Microsoft.ManagedServices/registrationDefinitions/1ccdb215-959a-48b9-bd7c-0584d461ea6c\",\r\n \"type\": \"Microsoft.ManagedServices/registrationDefinitions\",\r\n \"name\": \"1ccdb215-959a-48b9-bd7c-0584d461ea6c\"\r\n}", + "ResponseBody": "{\r\n \"properties\": {\r\n \"registrationDefinitionName\": \"Resource display name\",\r\n \"managedByTenantId\": \"bab3375b-6197-4a15-a44b-16c41faa91d7\",\r\n \"authorizations\": [\r\n {\r\n \"principalId\": \"d6f6c88a-5b7a-455e-ba40-ce146d4d3671\",\r\n \"roleDefinitionId\": \"acdd72a7-3385-48ef-bd42-f606fba81ae7\"\r\n }\r\n ],\r\n \"provisioningState\": \"Succeeded\",\r\n \"managedByTenantName\": \"Default Directory\"\r\n },\r\n \"id\": \"/subscriptions/002b3477-bfbf-4402-b377-6003168b75d3/providers/Microsoft.ManagedServices/registrationDefinitions/1ccdb215-959a-48b9-bd7c-0584d461ea6c\",\r\n \"type\": \"Microsoft.ManagedServices/registrationDefinitions\",\r\n \"name\": \"1ccdb215-959a-48b9-bd7c-0584d461ea6c\"\r\n}", "StatusCode": 200 }, { @@ -375,7 +375,7 @@ "-1" ] }, - "ResponseBody": "{\r\n \"properties\": {\r\n \"registrationDefinitionId\": \"/subscriptions/002b3477-bfbf-4402-b377-6003168b75d3/providers/Microsoft.ManagedServices/registrationDefinitions/1ccdb215-959a-48b9-bd7c-0584d461ea6c\",\r\n \"provisioningState\": \"Succeeded\",\r\n \"registrationDefinition\": {\r\n \"properties\": {\r\n \"registrationDefinitionName\": \"ps4125\",\r\n \"managedByTenantId\": \"bab3375b-6197-4a15-a44b-16c41faa91d7\",\r\n \"authorizations\": [\r\n {\r\n \"principalId\": \"d6f6c88a-5b7a-455e-ba40-ce146d4d3671\",\r\n \"roleDefinitionId\": \"acdd72a7-3385-48ef-bd42-f606fba81ae7\"\r\n }\r\n ],\r\n \"provisioningState\": \"Succeeded\",\r\n \"manageeTenantId\": \"72f988bf-86f1-41af-91ab-2d7cd011db47\",\r\n \"manageeTenantName\": \"Microsoft\",\r\n \"managedByTenantName\": \"Default Directory\"\r\n },\r\n \"id\": \"/subscriptions/002b3477-bfbf-4402-b377-6003168b75d3/providers/Microsoft.ManagedServices/registrationDefinitions/1ccdb215-959a-48b9-bd7c-0584d461ea6c\",\r\n \"type\": \"Microsoft.ManagedServices/registrationDefinitions\",\r\n \"name\": \"1ccdb215-959a-48b9-bd7c-0584d461ea6c\"\r\n }\r\n },\r\n \"id\": \"/subscriptions/002b3477-bfbf-4402-b377-6003168b75d3/providers/Microsoft.ManagedServices/registrationAssignments/8af8768c-73c2-4993-86ae-7a45c9b232c6\",\r\n \"type\": \"Microsoft.ManagedServices/registrationAssignments\",\r\n \"name\": \"8af8768c-73c2-4993-86ae-7a45c9b232c6\"\r\n}", + "ResponseBody": "{\r\n \"properties\": {\r\n \"registrationDefinitionId\": \"/subscriptions/002b3477-bfbf-4402-b377-6003168b75d3/providers/Microsoft.ManagedServices/registrationDefinitions/1ccdb215-959a-48b9-bd7c-0584d461ea6c\",\r\n \"provisioningState\": \"Succeeded\",\r\n \"registrationDefinition\": {\r\n \"properties\": {\r\n \"registrationDefinitionName\": \"Resource display name\",\r\n \"managedByTenantId\": \"bab3375b-6197-4a15-a44b-16c41faa91d7\",\r\n \"authorizations\": [\r\n {\r\n \"principalId\": \"d6f6c88a-5b7a-455e-ba40-ce146d4d3671\",\r\n \"roleDefinitionId\": \"acdd72a7-3385-48ef-bd42-f606fba81ae7\"\r\n }\r\n ],\r\n \"provisioningState\": \"Succeeded\",\r\n \"manageeTenantId\": \"72f9acbf-86f1-41af-91ab-2d7ef011db47\",\r\n \"manageeTenantName\": \"Microsoft\",\r\n \"managedByTenantName\": \"Default Directory\"\r\n },\r\n \"id\": \"/subscriptions/002b3477-bfbf-4402-b377-6003168b75d3/providers/Microsoft.ManagedServices/registrationDefinitions/1ccdb215-959a-48b9-bd7c-0584d461ea6c\",\r\n \"type\": \"Microsoft.ManagedServices/registrationDefinitions\",\r\n \"name\": \"1ccdb215-959a-48b9-bd7c-0584d461ea6c\"\r\n }\r\n },\r\n \"id\": \"/subscriptions/002b3477-bfbf-4402-b377-6003168b75d3/providers/Microsoft.ManagedServices/registrationAssignments/8af8768c-73c2-4993-86ae-7a45c9b232c6\",\r\n \"type\": \"Microsoft.ManagedServices/registrationAssignments\",\r\n \"name\": \"8af8768c-73c2-4993-86ae-7a45c9b232c6\"\r\n}", "StatusCode": 200 }, { diff --git a/src/ManagedServices/ManagedServices/ChangeLog.md b/src/ManagedServices/ManagedServices/ChangeLog.md index df7f329c1c55..9ee7c0f696d4 100644 --- a/src/ManagedServices/ManagedServices/ChangeLog.md +++ b/src/ManagedServices/ManagedServices/ChangeLog.md @@ -18,6 +18,7 @@ - Additional information about change #1 --> ## Upcoming Release +* [Breaking Change]Updated parametersnaming conventions and associated examples ## Version 1.1.1 * Updated breaking change warnings on cmdlets of managed services assignment and definition diff --git a/src/ManagedServices/ManagedServices/Commands/GetAzureRmManagedServicesAssignment.cs b/src/ManagedServices/ManagedServices/Commands/GetAzureRmManagedServicesAssignment.cs index 1927c44fc168..efe34f360baa 100644 --- a/src/ManagedServices/ManagedServices/Commands/GetAzureRmManagedServicesAssignment.cs +++ b/src/ManagedServices/ManagedServices/Commands/GetAzureRmManagedServicesAssignment.cs @@ -14,81 +14,57 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Commands { + using Microsoft.Azure.Commands.ResourceManager.Common; using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters; - using Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Extensions; using Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models; - using Microsoft.WindowsAzure.Commands.Common.CustomAttributes; using Microsoft.WindowsAzure.Commands.Utilities.Common; using System; using System.Management.Automation; [Cmdlet( VerbsCommon.Get, - Microsoft.Azure.Commands.ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "ManagedServicesAssignment", + AzureRMConstants.AzureRMPrefix + "ManagedServicesAssignment", DefaultParameterSetName = DefaultParameterSet), OutputType(typeof(PSRegistrationAssignment))] public class GetAzureRmManagedServicesAssignment : ManagedServicesCmdletBase { protected const string DefaultParameterSet = "Default"; - protected const string ByResourceIdParameterSet = "ByResourceId"; - protected const string ByIdParameterSet = "ById"; + protected const string ByNameParameterSet = "ByName"; - [Parameter(Mandatory = false, ParameterSetName = DefaultParameterSet, HelpMessage = "The scope where the registration assignment is created.")] - [Parameter(Mandatory = false, ParameterSetName = ByIdParameterSet, HelpMessage = "The scope where the registration assignment is created.")] + [Parameter(Mandatory = false, ParameterSetName = DefaultParameterSet, HelpMessage = "The scope where the registration assignment created.")] + [Parameter(Mandatory = false, ParameterSetName = ByNameParameterSet, HelpMessage = "The scope where the registration assignment created.")] + [ValidateNotNullOrEmpty] [ScopeCompleter] public string Scope { get; set; } - [CmdletParameterBreakingChange( - nameOfParameterChanging: "Id", - deprecateByVersion: ManagedServicesUtility.UpcomingVersion, - changeInEfectByDate: ManagedServicesUtility.UpcomingVersionReleaseDate, - ReplaceMentCmdletParameterName = "Name")] - [Parameter(Mandatory = true, ParameterSetName = ByIdParameterSet, HelpMessage = "The Registration Assignment identifier.")] - [ValidateNotNullOrEmpty] - public string Id { get; set; } - - [CmdletParameterBreakingChange( - nameOfParameterChanging: "ResourceId", - deprecateByVersion: ManagedServicesUtility.UpcomingVersion, - changeInEfectByDate: ManagedServicesUtility.UpcomingVersionReleaseDate, - ChangeDescription = ManagedServicesUtility.DeprecatedParameterDescription)] - [Parameter( - Mandatory = true, - ValueFromPipelineByPropertyName = true, - ParameterSetName = ByResourceIdParameterSet, - HelpMessage = "The fully qualified resource id of registration assignment.")] + [Parameter(Mandatory = false, ParameterSetName = ByNameParameterSet, HelpMessage = "The unique name of the Registration Assignment.")] [ValidateNotNullOrEmpty] - public string ResourceId { get; set; } + public string Name { get; set; } - [Parameter(ParameterSetName = DefaultParameterSet, HelpMessage = "Whether to include registration definition details.")] - [Parameter(ParameterSetName = ByResourceIdParameterSet, HelpMessage = "Whether to include registration definition details.")] - [Parameter(ParameterSetName = ByIdParameterSet, HelpMessage = "Whether to include registration definition details.")] + [Parameter(Mandatory = false, ParameterSetName = DefaultParameterSet, HelpMessage = "Whether to include registration definition details.")] + [Parameter(Mandatory = false, ParameterSetName = ByNameParameterSet, HelpMessage = "Whether to include registration definition details.")] public SwitchParameter ExpandRegistrationDefinition { get; set; } public override void ExecuteCmdlet() { - string scope = null; + string scope = this.GetDefaultScope(); string assignmentId = null; - if (this.IsParameterBound(x => x.ResourceId)) - { - assignmentId = this.ResourceId.GetResourceName(); - scope = this.ResourceId.GetSubscriptionId().ToSubscriptionResourceId(); - } - else if (this.IsParameterBound(x => x.Id)) + if (this.IsParameterBound(x => x.Name)) { - assignmentId = this.Id; - scope = this.Scope ?? this.GetDefaultScope(); + if (!this.Name.IsGuid()) + { + throw new ApplicationException("Name must be a valid GUID."); + } + + assignmentId = this.Name; } - else if (this.IsParameterBound(x => x.Scope)) + + if (this.IsParameterBound(x => x.Scope)) { scope = this.Scope; } - else - { - scope = this.GetDefaultScope(); - } - if (string.IsNullOrEmpty(assignmentId)) + if (string.IsNullOrWhiteSpace(assignmentId)) { var results = this.PSManagedServicesClient.ListRegistrationAssignments( scope: scope, @@ -97,12 +73,6 @@ public override void ExecuteCmdlet() } else { - // validate assignmentId. - if (!assignmentId.IsGuid()) - { - throw new ApplicationException("RegistrationAssignment must be a valid GUID."); - } - var result = this.PSManagedServicesClient.GetRegistrationAssignment( scope: scope, registrationAssignmentId: assignmentId, diff --git a/src/ManagedServices/ManagedServices/Commands/GetAzureRmManagedServicesDefinition.cs b/src/ManagedServices/ManagedServices/Commands/GetAzureRmManagedServicesDefinition.cs index 7c544bf49db9..2587a3f68489 100644 --- a/src/ManagedServices/ManagedServices/Commands/GetAzureRmManagedServicesDefinition.cs +++ b/src/ManagedServices/ManagedServices/Commands/GetAzureRmManagedServicesDefinition.cs @@ -12,41 +12,33 @@ // limitations under the License. // ---------------------------------------------------------------------------------- -using Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Extensions; -using Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models; -using Microsoft.WindowsAzure.Commands.Common.CustomAttributes; -using Microsoft.WindowsAzure.Commands.Utilities.Common; -using System; -using System.Management.Automation; - namespace Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Commands { + using Microsoft.Azure.Commands.ResourceManager.Common; + using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters; + using Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models; + using Microsoft.WindowsAzure.Commands.Utilities.Common; + using System; + using System.Management.Automation; + [Cmdlet( - VerbsCommon.Get, - Microsoft.Azure.Commands.ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "ManagedServicesDefinition", - DefaultParameterSetName = ByIdParameterSet), OutputType(typeof(PSRegistrationDefinition))] + VerbsCommon.Get, + AzureRMConstants.AzureRMPrefix + "ManagedServicesDefinition", + DefaultParameterSetName = ByNameParameterSet), OutputType(typeof(PSRegistrationDefinition))] public class GetAzureRmManagedServicesDefinition : ManagedServicesCmdletBase { - ////protected const string DefaultParameterSet = "Default"; - protected const string ByResourceIdParameterSet = "ByResourceId"; - protected const string ByIdParameterSet = "ById"; + protected const string DefaultParameterSet = "Default"; + protected const string ByNameParameterSet = "ByName"; - [Parameter(ParameterSetName = ByIdParameterSet, Mandatory = false, HelpMessage = "The registration definition identifier.")] + [Parameter(Mandatory = false, ParameterSetName = DefaultParameterSet, HelpMessage = "The scope where the registration definition created.")] + [Parameter(Mandatory = false, ParameterSetName = ByNameParameterSet, HelpMessage = "The scope where the registration definition created.")] [ValidateNotNullOrEmpty] - public string Name { get; set; } + [ScopeCompleter] + public string Scope { get; set; } - [CmdletParameterBreakingChange( - nameOfParameterChanging: "ResourceId", - deprecateByVersion: ManagedServicesUtility.UpcomingVersion, - changeInEfectByDate: ManagedServicesUtility.UpcomingVersionReleaseDate, - ChangeDescription = ManagedServicesUtility.DeprecatedParameterDescription)] - [Parameter( - ParameterSetName = ByResourceIdParameterSet, - Mandatory = true, - ValueFromPipelineByPropertyName = true, - HelpMessage = "The full qualified resource id of registration definition.")] + [Parameter(Mandatory = false, ParameterSetName = ByNameParameterSet, HelpMessage = "The unique name of the Registration Definition.")] [ValidateNotNullOrEmpty] - public string ResourceId { get; set; } + public string Name { get; set; } public override void ExecuteCmdlet() { @@ -55,15 +47,20 @@ public override void ExecuteCmdlet() if (this.IsParameterBound(x => x.Name)) { + if (!this.Name.IsGuid()) + { + throw new ApplicationException("Name must be a valid GUID."); + } + definitionId = this.Name; } - else if (this.IsParameterBound(x => x.ResourceId)) + + if (this.IsParameterBound(x => x.Scope)) { - definitionId = this.ResourceId.GetResourceName(); - scope = this.ResourceId.GetSubscriptionId().ToSubscriptionResourceId(); + scope = this.Scope; } - if (string.IsNullOrEmpty(definitionId)) + if (string.IsNullOrWhiteSpace(definitionId)) { var results = this.PSManagedServicesClient.ListRegistrationDefinitions( scope: scope); @@ -71,12 +68,6 @@ public override void ExecuteCmdlet() } else { - // validate definitionId. - if (!definitionId.IsGuid()) - { - throw new ApplicationException("RegistrationDefinitionId must be a valid GUID."); - } - var result = this.PSManagedServicesClient.GetRegistrationDefinition( scope: scope, registrationDefinitionId: definitionId); @@ -84,4 +75,4 @@ public override void ExecuteCmdlet() } } } -} +} \ No newline at end of file diff --git a/src/ManagedServices/ManagedServices/Commands/NewAzureRmManagedServicesAssignment.cs b/src/ManagedServices/ManagedServices/Commands/NewAzureRmManagedServicesAssignment.cs index 1792bf257a41..097f28184912 100644 --- a/src/ManagedServices/ManagedServices/Commands/NewAzureRmManagedServicesAssignment.cs +++ b/src/ManagedServices/ManagedServices/Commands/NewAzureRmManagedServicesAssignment.cs @@ -12,103 +12,95 @@ // limitations under the License. // ---------------------------------------------------------------------------------- -using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters; -using Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Extensions; -using Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models; -using Microsoft.WindowsAzure.Commands.Common.CustomAttributes; -using Microsoft.WindowsAzure.Commands.Utilities.Common; -using System; -using System.Collections.Generic; -using System.Management.Automation; -using System.Text; - namespace Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Commands { + using Microsoft.Azure.Commands.ResourceManager.Common; + using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters; + using Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models; + using Microsoft.WindowsAzure.Commands.Utilities.Common; + using System; + using System.Management.Automation; + // TODO (rajivnan) move strings to resources? [Cmdlet( - VerbsCommon.New, - Microsoft.Azure.Commands.ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "ManagedServicesAssignment", - DefaultParameterSetName = DefaultParameterSet, - SupportsShouldProcess = true), OutputType(typeof(PSRegistrationAssignment))] + VerbsCommon.New, + AzureRMConstants.AzureRMPrefix + "ManagedServicesAssignment", + DefaultParameterSetName = DefaultParameterSet, + SupportsShouldProcess = true), OutputType(typeof(PSRegistrationAssignment))] public class NewAzureRmManagedServicesAssignment : ManagedServicesCmdletBase { protected const string DefaultParameterSet = "Default"; - protected const string ByResourceIdParameterSet = "ByResourceId"; protected const string ByInputObjectParameterSet = "ByInputObject"; - [Parameter(Position = 0, ParameterSetName = DefaultParameterSet, Mandatory = false, HelpMessage = "The scope where the registration assignment should be created.")] - [Parameter(Position = 0, ParameterSetName = ByResourceIdParameterSet, Mandatory = false, HelpMessage = "The scope where the registration assignment should be created.")] - [Parameter(Position = 0, ParameterSetName = ByInputObjectParameterSet, Mandatory = false, HelpMessage = "The scope where the registration assignment should be created.")] - [ScopeCompleter] - public string Scope { get; set; } - - [CmdletParameterBreakingChange( - nameOfParameterChanging: "RegistrationDefinitionName", - deprecateByVersion: ManagedServicesUtility.UpcomingVersion, - changeInEfectByDate: ManagedServicesUtility.UpcomingVersionReleaseDate, - ChangeDescription = ManagedServicesUtility.DeprecatedParameterDescription)] - [Parameter(ParameterSetName = DefaultParameterSet, Mandatory = true, HelpMessage = "The registration definition identifier.")] + [Parameter(ParameterSetName = DefaultParameterSet, Mandatory = false, HelpMessage = "The unique name of the Registration Assignment.")] + [Parameter(ParameterSetName = ByInputObjectParameterSet, Mandatory = false, HelpMessage = "The unique name of the Registration Assignment.")] [ValidateNotNullOrEmpty] - public string RegistrationDefinitionName { get; set; } - - [CmdletParameterBreakingChange( - nameOfParameterChanging: "RegistrationDefinitionResourceId", - deprecateByVersion: ManagedServicesUtility.UpcomingVersion, - changeInEfectByDate: ManagedServicesUtility.UpcomingVersionReleaseDate, - ReplaceMentCmdletParameterName = "RegistrationDefinitionId")] - [Parameter(ParameterSetName = ByResourceIdParameterSet, ValueFromPipelineByPropertyName = true, Mandatory = true, HelpMessage = "The fully qualified resource id of the registration definition.")] + public string Name { get; set; } + + [Parameter(ParameterSetName = DefaultParameterSet, Mandatory = false, HelpMessage = "The scope where the registration assignment should be created.")] + [Parameter(ParameterSetName = ByInputObjectParameterSet, Mandatory = false, HelpMessage = "The scope where the registration assignment should be created.")] + [ScopeCompleter] [ValidateNotNullOrEmpty] - [Alias("ResourceId")] - public string RegistrationDefinitionResourceId { get; set; } + public string Scope { get; set; } [Parameter(ParameterSetName = ByInputObjectParameterSet, ValueFromPipeline = true, Mandatory = true, HelpMessage = "The registration definition input object.")] + [ValidateNotNull] public PSRegistrationDefinition RegistrationDefinition { get; set; } + [Parameter(ParameterSetName = DefaultParameterSet, ValueFromPipelineByPropertyName = true, Mandatory = true, HelpMessage = "The fully qualified resource id of the registration definition.")] + [ValidateNotNullOrEmpty] + public string RegistrationDefinitionId { get; set; } + [Parameter(Mandatory = false, HelpMessage = "Run cmdlet in the background")] public SwitchParameter AsJob { get; set; } - public Guid RegistrationAssignmentId { get; set; } = default(Guid); - public override void ExecuteCmdlet() { - string scope = this.GetDefaultScope(); - string definitionId = this.RegistrationDefinitionResourceId; + var definitionId = String.Empty; + var assignmentId = Guid.NewGuid().ToString(); + var scope = this.GetDefaultScope(); - if (this.IsParameterBound(x => x.RegistrationDefinitionName)) + if (!String.IsNullOrWhiteSpace(this.Name)) { - scope = this.Scope ?? this.GetDefaultScope(); - var subscriptionScope = scope.GetSubscriptionId().ToSubscriptionResourceId(); + if (!this.Name.IsGuid()) + { + throw new ApplicationException("Name must be a valid GUID."); + } - // registation definitions can only exist at the subscription level. - definitionId = $"{subscriptionScope}/providers/Microsoft.ManagedServices/registrationDefinitions/{this.RegistrationDefinitionName}"; + assignmentId = (new Guid(this.Name)).ToString(); } - else if (this.IsParameterBound(x => x.RegistrationDefinitionResourceId)) + + if (this.IsParameterBound(x => x.RegistrationDefinition)) { - definitionId = this.RegistrationDefinitionResourceId; - scope = this.Scope ?? definitionId.GetSubscriptionId().ToSubscriptionResourceId(); + definitionId = this.RegistrationDefinition.Id; } - else if (this.IsParameterBound(x => x.RegistrationDefinition)) + + if (this.IsParameterBound(x => x.RegistrationDefinitionId)) { - definitionId = this.RegistrationDefinition.Id; - scope = this.Scope ?? definitionId.GetSubscriptionId().ToSubscriptionResourceId(); + definitionId = this.RegistrationDefinitionId; + } + + if (this.IsParameterBound(x => x.Scope)) + { + scope = this.Scope; } - if (this.RegistrationAssignmentId == default(Guid)) + if (string.IsNullOrWhiteSpace(definitionId)) { - this.RegistrationAssignmentId = Guid.NewGuid(); + throw new ApplicationException("RegistrationDefinition details are required. Please provider either RegistrationDefinition or RegistrationDefinitionId parameters."); } ConfirmAction(MyInvocation.InvocationName, - $"{scope}/providers/Microsoft.ManagedServices/registrationAssignments/{this.RegistrationAssignmentId}", + $"{scope}/providers/Microsoft.ManagedServices/registrationAssignments/{assignmentId}", () => { var result = this.PSManagedServicesClient.CreateOrUpdateRegistrationAssignment( scope: scope, registrationDefinitionId: definitionId, - registrationAssignmentId: this.RegistrationAssignmentId); + registrationAssignmentId: assignmentId); WriteObject(new PSRegistrationAssignment(result), true); }); } } -} +} \ No newline at end of file diff --git a/src/ManagedServices/ManagedServices/Commands/NewAzureRmManagedServicesDefinition.cs b/src/ManagedServices/ManagedServices/Commands/NewAzureRmManagedServicesDefinition.cs index 4918cc6f8163..d62fb8ad52b7 100644 --- a/src/ManagedServices/ManagedServices/Commands/NewAzureRmManagedServicesDefinition.cs +++ b/src/ManagedServices/ManagedServices/Commands/NewAzureRmManagedServicesDefinition.cs @@ -12,55 +12,61 @@ // limitations under the License. // ---------------------------------------------------------------------------------- -using Microsoft.Azure.Management.ManagedServices.Models; -using Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Extensions; -using Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models; -using Microsoft.WindowsAzure.Commands.Common.CustomAttributes; -using Microsoft.WindowsAzure.Commands.Utilities.Common; -using System; -using System.Collections.Generic; -using System.Management.Automation; -using System.Text; - namespace Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Commands { - [GenericBreakingChange( - message: "New mandatory parameter 'DisplayName' will be added to represent a user-friendly name for a registration definition", - deprecateByVersion: ManagedServicesUtility.UpcomingVersion, - changeInEfectByDate: ManagedServicesUtility.UpcomingVersionReleaseDate)] - [GenericBreakingChange( - message: "New mandatory parameter 'Authorization' will be added to represent a list containing principal IDs and role definition IDs.", - deprecateByVersion: ManagedServicesUtility.UpcomingVersion, - changeInEfectByDate: ManagedServicesUtility.UpcomingVersionReleaseDate)] + using Microsoft.Azure.Commands.ResourceManager.Common; + using Microsoft.Azure.Management.ManagedServices.Models; + using Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models; + using Microsoft.WindowsAzure.Commands.Utilities.Common; + using System; + using System.Management.Automation; + [Cmdlet( - VerbsCommon.New, - Microsoft.Azure.Commands.ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "ManagedServicesDefinition", - DefaultParameterSetName = DefaultParameterSet, - SupportsShouldProcess = true), OutputType(typeof(PSRegistrationDefinition))] + VerbsCommon.New, AzureRMConstants.AzureRMPrefix + "ManagedServicesDefinition", + DefaultParameterSetName = DefaultParameterSet, + SupportsShouldProcess = true), OutputType(typeof(PSRegistrationDefinition))] public class NewAzureRmManagedServicesDefinition : ManagedServicesCmdletBase { protected const string DefaultParameterSet = "Default"; protected const string ByPlanParameterSet = "ByPlan"; + protected const string ByAuthorizationParameterSet = "ByAuthorization"; - [Parameter(ParameterSetName = DefaultParameterSet, Mandatory = true, HelpMessage = "The name of the Registration Definition.")] - [Parameter(ParameterSetName = ByPlanParameterSet, Mandatory = true, HelpMessage = "The name of the Registration Definition.")] + [Parameter(ParameterSetName = DefaultParameterSet, Mandatory = false, HelpMessage = "The unique name of the Registration Definition.")] + [Parameter(ParameterSetName = ByPlanParameterSet, Mandatory = false, HelpMessage = "The unique name of the Registration Definition.")] + [Parameter(ParameterSetName = ByAuthorizationParameterSet, Mandatory = false, HelpMessage = "The unique name of the Registration Definition.")] + [ValidateNotNullOrEmpty] public string Name { get; set; } + [Parameter(ParameterSetName = DefaultParameterSet, Mandatory = true, HelpMessage = "The display name of the Registration Definition.")] + [Parameter(ParameterSetName = ByPlanParameterSet, Mandatory = true, HelpMessage = "The display name of the Registration Definition.")] + [Parameter(ParameterSetName = ByAuthorizationParameterSet, Mandatory = true, HelpMessage = "The display name of the Registration Definition.")] + [ValidateNotNullOrEmpty] + public string DisplayName { get; set; } + [Parameter(ParameterSetName = DefaultParameterSet, Mandatory = true, HelpMessage = "The ManagedBy Tenant Identifier.")] [Parameter(ParameterSetName = ByPlanParameterSet, Mandatory = true, HelpMessage = "The ManagedBy Tenant Identifier.")] + [Parameter(ParameterSetName = ByAuthorizationParameterSet, Mandatory = true, HelpMessage = "The ManagedBy Tenant Identifier.")] + [ValidateNotNullOrEmpty] public string ManagedByTenantId { get; set; } + [Parameter(ParameterSetName = DefaultParameterSet, Mandatory = false, HelpMessage = "The description of the Registration Definition.")] + [Parameter(ParameterSetName = ByPlanParameterSet, Mandatory = false, HelpMessage = "The description of the Registration Definition.")] + [Parameter(ParameterSetName = ByAuthorizationParameterSet, Mandatory = false, HelpMessage = "The description of the Registration Definition.")] + [ValidateNotNullOrEmpty] + public string Description { get; set; } + [Parameter(ParameterSetName = DefaultParameterSet, Mandatory = true, HelpMessage = "The ManagedBy Principal Identifier.")] - [Parameter(ParameterSetName = ByPlanParameterSet, Mandatory = true, HelpMessage = "The ManagedBy Principal Identifier.")] + [ValidateNotNullOrEmpty] public string PrincipalId { get; set; } - [Parameter(ParameterSetName = DefaultParameterSet, Mandatory = true, HelpMessage = "The Managed Service Provider's Role Identifier.")] - [Parameter(ParameterSetName = ByPlanParameterSet, Mandatory = true, HelpMessage = "The Managed Service Provider's Role Identifier.")] + [Parameter(ParameterSetName = DefaultParameterSet, Mandatory = true, HelpMessage = "The role definition identifier to grant permissions to principal identifier.")] + [ValidateNotNullOrEmpty] public string RoleDefinitionId { get; set; } - [Parameter(ParameterSetName = DefaultParameterSet, Mandatory = false, HelpMessage = "The description of the Registration Definition.")] - [Parameter(ParameterSetName = ByPlanParameterSet, Mandatory = false, HelpMessage = "The description of the Registration Definition.")] - public string Description { get; set; } + [Parameter(ParameterSetName = ByPlanParameterSet, Mandatory = true, HelpMessage = "The authorization mapping list with principalId - roleDefinitionId.")] + [Parameter(ParameterSetName = ByAuthorizationParameterSet, Mandatory = true, HelpMessage = "The authorization mapping list with principalId - roleDefinitionId.")] + [ValidateNotNull] + public Authorization[] Authorization { get; set; } [Parameter(ParameterSetName = ByPlanParameterSet, Mandatory = true, HelpMessage = "The name of the plan.")] [ValidateNotNullOrEmpty] @@ -81,77 +87,95 @@ public class NewAzureRmManagedServicesDefinition : ManagedServicesCmdletBase [Parameter(Mandatory = false, HelpMessage = "Run cmdlet in the background")] public SwitchParameter AsJob { get; set; } - public Guid RegistrationDefinitionId { get; set; } = default(Guid); - public override void ExecuteCmdlet() { var scope = this.GetDefaultScope(); + var definitionId = Guid.NewGuid().ToString(); + var managedByTenantId = string.Empty; + + if (this.IsParameterBound(x => x.Name)) + { + if (!this.Name.IsGuid()) + { + throw new ApplicationException("Name must be a valid GUID."); + } + + definitionId = (new Guid(this.Name)).ToString(); + } if (!this.ManagedByTenantId.IsGuid()) { throw new ApplicationException("ManagedByTenantId must be a valid GUID."); } + else + { + managedByTenantId = (new Guid(this.ManagedByTenantId)).ToString(); + } - if (!this.PrincipalId.IsGuid()) + if (this.IsParameterBound(x => x.Authorization) && + (this.IsParameterBound(x => x.PrincipalId) || this.IsParameterBound(x => x.RoleDefinitionId))) { - throw new ApplicationException("PrincipalId must be a valid GUID."); + throw new ApplicationException("Authorization parameter is supported only when RoleDefinitionId and PrincipalId are null."); } - if (!this.RoleDefinitionId.IsGuid()) + if (!this.IsParameterBound(x => x.Authorization) && + (!this.IsParameterBound(x => x.PrincipalId) || !this.IsParameterBound(x => x.RoleDefinitionId))) { - throw new ApplicationException("RoleDefinitionId must be a valid GUID."); + throw new ApplicationException("Please provide RoleDefinitionId and PrincipalId parameters together or Authorization parameter."); } - if (this.RegistrationDefinitionId == default(Guid)) + if (this.Authorization == null && + this.IsParameterBound(x => x.PrincipalId) && + this.IsParameterBound(x => x.RoleDefinitionId)) { - this.RegistrationDefinitionId = Guid.NewGuid(); + this.Authorization = new Authorization[] + { + new Authorization + { + RoleDefinitionId = this.RoleDefinitionId, + PrincipalId = this.PrincipalId + } + }; + } + + Plan plan = null; + if (this.IsParameterBound(x => x.PlanName) && + this.IsParameterBound(x => x.PlanPublisher) && + this.IsParameterBound(x => x.PlanProduct) && + this.IsParameterBound(x => x.PlanVersion)) + { + plan = new Plan + { + Name = this.PlanName, + Product = this.PlanProduct, + Publisher = this.PlanPublisher, + Version = this.PlanVersion + }; } ConfirmAction(MyInvocation.InvocationName, - $"{scope}/providers/Microsoft.ManagedServices/registrationDefinitions/{this.RegistrationDefinitionId}", - () => + $"{scope}/providers/Microsoft.ManagedServices/registrationDefinitions/{definitionId}", + () => + { + var registrationDefinition = new RegistrationDefinition { - Plan plan = null; - if (this.IsParameterBound(x => x.PlanName) && - this.IsParameterBound(x => x.PlanPublisher) && - this.IsParameterBound(x => x.PlanProduct) && - this.IsParameterBound(x => x.PlanVersion)) + Plan = plan, + Properties = new RegistrationDefinitionProperties { - plan = new Plan - { - Name = this.PlanName, - Product = this.PlanProduct, - Publisher = this.PlanPublisher, - Version = this.PlanVersion - }; + Description = this.Description, + RegistrationDefinitionName = this.DisplayName, + ManagedByTenantId = managedByTenantId, + Authorizations = this.Authorization } + }; - var registrationDefinition = new RegistrationDefinition - { - Plan = plan, - Properties = new RegistrationDefinitionProperties - { - Description = this.Description, - RegistrationDefinitionName = this.Name, - ManagedByTenantId = this.ManagedByTenantId, - Authorizations = new List - { - new Authorization - { - PrincipalId =this.PrincipalId, - RoleDefinitionId =this.RoleDefinitionId - } - } - } - }; - - var result = this.PSManagedServicesClient.CreateOrUpdateRegistrationDefinition( - scope: scope, - registrationDefinition: registrationDefinition, - registratonDefinitionId: this.RegistrationDefinitionId); - - WriteObject(new PSRegistrationDefinition(result), true); - }); + var result = this.PSManagedServicesClient.CreateOrUpdateRegistrationDefinition( + scope: scope, + registrationDefinition: registrationDefinition, + registratonDefinitionId: definitionId); + + WriteObject(new PSRegistrationDefinition(result), true); + }); } } -} +} \ No newline at end of file diff --git a/src/ManagedServices/ManagedServices/Commands/RemoveAzureRmManagedServcicesAssignment.cs b/src/ManagedServices/ManagedServices/Commands/RemoveAzureRmManagedServcicesAssignment.cs index 42d3f413a980..4fef6961d3bf 100644 --- a/src/ManagedServices/ManagedServices/Commands/RemoveAzureRmManagedServcicesAssignment.cs +++ b/src/ManagedServices/ManagedServices/Commands/RemoveAzureRmManagedServcicesAssignment.cs @@ -12,82 +12,79 @@ // limitations under the License. // ---------------------------------------------------------------------------------- -using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters; -using Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Extensions; -using Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models; -using Microsoft.WindowsAzure.Commands.Common.CustomAttributes; -using Microsoft.WindowsAzure.Commands.Utilities.Common; -using System; -using System.Management.Automation; -using System.Text.RegularExpressions; - namespace Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Commands { + using Microsoft.Azure.Commands.ResourceManager.Common; + using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters; + using Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models; + using Microsoft.WindowsAzure.Commands.Utilities.Common; + using System; + using System.Management.Automation; + [Cmdlet( VerbsCommon.Remove, - Microsoft.Azure.Commands.ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "ManagedServicesAssignment", + AzureRMConstants.AzureRMPrefix + "ManagedServicesAssignment", DefaultParameterSetName = DefaultParameterSet, - SupportsShouldProcess = true), OutputType(typeof(void))] + SupportsShouldProcess = true), OutputType(typeof(bool))] public class RemoveAzureRmManagedServcicesAssignment : ManagedServicesCmdletBase { protected const string DefaultParameterSet = "Default"; - protected const string ByResourceIdParameterSet = "ByResourceId"; protected const string ByInputObjectParameterSet = "ByInputObject"; - [Parameter(Position = 0, ParameterSetName = DefaultParameterSet, Mandatory = false, HelpMessage = "The scope where the registration assignment should be created.")] + [Parameter(ParameterSetName = DefaultParameterSet, Mandatory = false, HelpMessage = "The scope of the registration assignment.")] + [ValidateNotNullOrEmpty] [ScopeCompleter] public string Scope { get; set; } - [CmdletParameterBreakingChange( - nameOfParameterChanging: "Id", - deprecateByVersion: ManagedServicesUtility.UpcomingVersion, - changeInEfectByDate: ManagedServicesUtility.UpcomingVersionReleaseDate, - ReplaceMentCmdletParameterName = "Name")] - [Parameter(ParameterSetName = DefaultParameterSet, Mandatory = true, HelpMessage = "The registration assignment Id.")] + [Parameter(ParameterSetName = DefaultParameterSet, Mandatory = true, HelpMessage = "The unique name of the Registration Assignment.")] [ValidateNotNullOrEmpty] - public string Id { get; set; } - - [CmdletParameterBreakingChange( - nameOfParameterChanging: "ResourceId", - deprecateByVersion: ManagedServicesUtility.UpcomingVersion, - changeInEfectByDate: ManagedServicesUtility.UpcomingVersionReleaseDate, - ChangeDescription = ManagedServicesUtility.DeprecatedParameterDescription)] - [Parameter(ParameterSetName = ByResourceIdParameterSet, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The fully qualified rsource id of the registration assignment.")] - [ValidateNotNullOrEmpty] - public string ResourceId { get; set; } + public string Name { get; set; } - [Parameter(Mandatory = true, ValueFromPipeline = true, HelpMessage = "The registration assignment object.", ParameterSetName = ByInputObjectParameterSet)] + [Parameter(ParameterSetName = ByInputObjectParameterSet, Mandatory = true, ValueFromPipeline = true, HelpMessage = "The registration assignment object.")] [ValidateNotNull] public PSRegistrationAssignment InputObject { get; set; } [Parameter(Mandatory = false, HelpMessage = "Run cmdlet in the background")] public SwitchParameter AsJob { get; set; } + [Parameter(Mandatory = false)] + public SwitchParameter PassThru { get; set; } + public override void ExecuteCmdlet() { - string scope = null; + string scope = this.GetDefaultScope(); string assignmentId = null; - if (this.IsParameterBound(x => x.Id)) + if (this.IsParameterBound(x => x.Name)) { - assignmentId = this.Id; - scope = this.Scope ?? this.GetDefaultScope(); - } - else if (this.IsParameterBound(x => x.InputObject)) - { - assignmentId = this.InputObject.Id.GetResourceName(); - if (!ManagedServicesUtility.TryParseAssignmentScopeFromResourceId(this.InputObject.Id, out scope)) + if (!this.Name.IsGuid()) { - throw new ApplicationException($"Unable to parse the scope from [{this.InputObject.Id}]"); + throw new ApplicationException("Name must be a valid GUID."); } + + assignmentId = (new Guid(this.Name)).ToString(); } - else if (this.IsParameterBound(x => x.ResourceId)) + + if (this.IsParameterBound(x => x.Scope)) { - assignmentId = this.ResourceId.GetResourceName(); - if (!ManagedServicesUtility.TryParseAssignmentScopeFromResourceId(this.ResourceId, out scope)) + scope = this.Scope; + } + + if (this.IsParameterBound(x => x.InputObject)) + { + if (!ManagedServicesUtility.TryParseAssignmentScopeFromResourceId(this.InputObject.Id, out scope) && + string.IsNullOrWhiteSpace(scope)) + { + throw new ApplicationException($"Unable to parse the scope from [{this.InputObject.Id}]."); + } + + if (string.IsNullOrWhiteSpace(this.InputObject.Name) || !this.InputObject.Name.IsGuid()) { - throw new ApplicationException($"Unable to parse the scope from [{this.ResourceId}]"); + throw new ApplicationException("Invalid registration assignment name provided in input object."); } + + assignmentId = this.InputObject.Name; } ConfirmAction(MyInvocation.InvocationName, @@ -97,7 +94,12 @@ public override void ExecuteCmdlet() this.PSManagedServicesClient.RemoveRegistrationAssignment( scope: scope, registrationAssignmentId: assignmentId); + + if (this.PassThru.IsPresent) + { + WriteObject(true); + } }); } } -} +} \ No newline at end of file diff --git a/src/ManagedServices/ManagedServices/Commands/RemoveAzureRmManagedServicesDefinition.cs b/src/ManagedServices/ManagedServices/Commands/RemoveAzureRmManagedServicesDefinition.cs index 714e18b1fcf2..a45139f3345d 100644 --- a/src/ManagedServices/ManagedServices/Commands/RemoveAzureRmManagedServicesDefinition.cs +++ b/src/ManagedServices/ManagedServices/Commands/RemoveAzureRmManagedServicesDefinition.cs @@ -12,86 +12,91 @@ // limitations under the License. // ---------------------------------------------------------------------------------- -using Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Extensions; -using Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models; -using Microsoft.WindowsAzure.Commands.Common.CustomAttributes; -using Microsoft.WindowsAzure.Commands.Utilities.Common; -using System; -using System.Management.Automation; - namespace Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Commands { - [Cmdlet( - VerbsCommon.Remove, - Microsoft.Azure.Commands.ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "ManagedServicesDefinition", - DefaultParameterSetName = DefaultParameterSet, - SupportsShouldProcess = true), OutputType(typeof(void))] + using Microsoft.Azure.Commands.ResourceManager.Common; + using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters; + using Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models; + using Microsoft.WindowsAzure.Commands.Utilities.Common; + using System; + using System.Management.Automation; + [Cmdlet( + VerbsCommon.Remove, + AzureRMConstants.AzureRMPrefix + "ManagedServicesDefinition", + DefaultParameterSetName = DefaultParameterSet, + SupportsShouldProcess = true), OutputType(typeof(bool))] public class RemoveAzureRmManagedServicesDefinition : ManagedServicesCmdletBase { protected const string DefaultParameterSet = "Default"; protected const string ByInputObjectParameterSet = "ByInputObject"; - protected const string ByResourceIdParameterSet = "ByResourceId"; - [CmdletParameterBreakingChange( - nameOfParameterChanging: "Id", - deprecateByVersion: ManagedServicesUtility.UpcomingVersion, - changeInEfectByDate: ManagedServicesUtility.UpcomingVersionReleaseDate, - ReplaceMentCmdletParameterName = "Name")] - [Parameter(ParameterSetName = DefaultParameterSet, Mandatory = true, HelpMessage = "The registration definition identifier.")] + [Parameter(ParameterSetName = DefaultParameterSet, Mandatory = false, HelpMessage = "The scope where the registration definition created.")] [ValidateNotNullOrEmpty] - public string Id { get; set; } + [ScopeCompleter] + public string Scope { get; set; } - [CmdletParameterBreakingChange( - nameOfParameterChanging: "ResourceId", - deprecateByVersion: ManagedServicesUtility.UpcomingVersion, - changeInEfectByDate: ManagedServicesUtility.UpcomingVersionReleaseDate, - ChangeDescription = ManagedServicesUtility.DeprecatedParameterDescription)] - [Parameter(ParameterSetName = ByResourceIdParameterSet, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The full qualified resource id of registration definition.")] + [Parameter(ParameterSetName = DefaultParameterSet, Mandatory = true, HelpMessage = "The unique name of the Registration Definition.")] [ValidateNotNullOrEmpty] - public string ResourceId { get; set; } + public string Name { get; set; } [Parameter(ParameterSetName = ByInputObjectParameterSet, Mandatory = true, ValueFromPipeline = true, HelpMessage = "The registration definition object.")] [ValidateNotNull] public PSRegistrationDefinition InputObject { get; set; } - [Parameter(Mandatory = false, HelpMessage = "Run cmdlet in the background")] - public SwitchParameter AsJob { get; set; } + [Parameter(Mandatory = false)] + public SwitchParameter PassThru { get; set; } public override void ExecuteCmdlet() { - string scope = null; + string scope = this.GetDefaultScope(); string definitionId = null; - if (this.IsParameterBound(x => x.Id)) + + if (this.IsParameterBound(x => x.Name)) + { + if (!this.Name.IsGuid()) + { + throw new ApplicationException("Name must be a valid GUID."); + } + + definitionId = (new Guid(this.Name)).ToString(); + } + + if (this.IsParameterBound(x => x.Scope)) { - scope = this.GetDefaultScope(); - definitionId = this.Id; + scope = this.Scope; } - else if (this.IsParameterBound(x => x.InputObject)) + + if (this.IsParameterBound(x => x.InputObject)) { - definitionId = this.InputObject.Id.GetResourceName(); - if(!ManagedServicesUtility.TryParseDefinitionScopeFromResourceId(this.InputObject.Id, out scope)) + if (!ManagedServicesUtility.TryParseDefinitionScopeFromResourceId(this.InputObject.Id, out scope) && + string.IsNullOrWhiteSpace(scope)) { throw new ApplicationException($"Unable to parse the scope from [{this.InputObject.Id}]"); } - } - else if (this.IsParameterBound(x => x.ResourceId)) - { - definitionId = this.ResourceId.GetResourceName(); - if (!ManagedServicesUtility.TryParseDefinitionScopeFromResourceId(this.ResourceId, out scope)) + + if (string.IsNullOrWhiteSpace(this.InputObject.Name) || !this.InputObject.Name.IsGuid()) { - throw new ApplicationException($"Unable to parse the scope from [{this.ResourceId}]"); + throw new ApplicationException("Invalid registration definition name provided in input object."); } + + definitionId = this.InputObject.Name; } ConfirmAction(MyInvocation.InvocationName, - $"/{scope}/providers/Microsoft.ManagedServices/registrationDefinitions{definitionId}", + $"/{scope}/providers/Microsoft.ManagedServices/registrationDefinitions/{definitionId}", () => { this.PSManagedServicesClient.RemoveRegistrationDefinition( scope: scope, registrationDefinitionId: definitionId); + + if (this.PassThru.IsPresent) + { + WriteObject(true); + } }); } } -} +} \ No newline at end of file diff --git a/src/ManagedServices/ManagedServices/Extensions/ManagedServicesExtensions.cs b/src/ManagedServices/ManagedServices/Extensions/ManagedServicesExtensions.cs index 77dbfc560e2b..42813e145a65 100644 --- a/src/ManagedServices/ManagedServices/Extensions/ManagedServicesExtensions.cs +++ b/src/ManagedServices/ManagedServices/Extensions/ManagedServicesExtensions.cs @@ -13,45 +13,14 @@ // ---------------------------------------------------------------------------------- using System; -using System.Linq; -using System.Management.Automation; -using Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models; -using Microsoft.Azure.Management.ManagedServices.Models; namespace Microsoft.Azure.PowerShell.Cmdlets.ManagedServices { public static class ManagedServicesExtensions { - public static string GetSubscriptionId(this string resourceId) - { - if (string.IsNullOrEmpty(resourceId)) - { - throw new PSArgumentException("resourceId cannot be null."); - } - - var entries = resourceId.Split('/'); - return entries[2]; - } - - public static string GetResourceName(this string resourceId) - { - if (string.IsNullOrEmpty(resourceId)) - { - throw new PSArgumentException("resourceId cannot be null."); - } - - var entries = resourceId.Split('/'); - return entries[entries.Length - 1]; - } - public static bool IsGuid(this string input) { - return Guid.TryParse(input, out Guid result); - } - - public static string ToSubscriptionResourceId(this string subscriptionId) - { - return $"/subscriptions/{subscriptionId}"; + return Guid.TryParse(input, out _); } } } diff --git a/src/ManagedServices/ManagedServices/Extensions/ManagedServicesUtility.cs b/src/ManagedServices/ManagedServices/Extensions/ManagedServicesUtility.cs index c524a7e05e75..f08e2aa95991 100644 --- a/src/ManagedServices/ManagedServices/Extensions/ManagedServicesUtility.cs +++ b/src/ManagedServices/ManagedServices/Extensions/ManagedServicesUtility.cs @@ -13,8 +13,6 @@ // ---------------------------------------------------------------------------------- using System; -using System.Collections.Generic; -using System.Text; using System.Text.RegularExpressions; namespace Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Extensions diff --git a/src/ManagedServices/ManagedServices/Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.generated.format.ps1xml b/src/ManagedServices/ManagedServices/Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.generated.format.ps1xml index f5897c609eff..bb9bde543d41 100644 --- a/src/ManagedServices/ManagedServices/Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.generated.format.ps1xml +++ b/src/ManagedServices/ManagedServices/Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.generated.format.ps1xml @@ -14,7 +14,11 @@ Left - + + + + Left + @@ -26,7 +30,11 @@ Left - $_.Properties.RegistrationDefinitionId + Id + + + Left + $_.Properties.ProvisioningState @@ -46,15 +54,11 @@ Left - + Left - - - - Left - + @@ -66,15 +70,11 @@ Left - $_.Properties.ManagedByTenantId - - - Left - $_.Properties.Authorization.PrincipalId + Id Left - $_.Properties.Authorization.RoleDefinitionId + $_.Properties.ProvisioningState diff --git a/src/ManagedServices/ManagedServices/Models/ManagedServicesClientWrapper.cs b/src/ManagedServices/ManagedServices/Models/ManagedServicesClientWrapper.cs index 766003789f8f..9733c641e2fa 100644 --- a/src/ManagedServices/ManagedServices/Models/ManagedServicesClientWrapper.cs +++ b/src/ManagedServices/ManagedServices/Models/ManagedServicesClientWrapper.cs @@ -16,12 +16,11 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models { using Microsoft.Azure.Commands.Common.Authentication; using Microsoft.Azure.Commands.Common.Authentication.Abstractions; + using Microsoft.Azure.Commands.ResourceManager.Common.Properties; using Microsoft.Azure.Management.ManagedServices; + using Microsoft.Azure.Management.ManagedServices.Models; using Microsoft.Rest.Azure; using System; - using Microsoft.Azure.Management.ManagedServices.Models; - using Microsoft.Azure.Commands.ResourceManager.Common.Properties; - using System.Threading.Tasks; /// /// Low-level API implementation for the ManagedServicesClient service. @@ -76,7 +75,7 @@ public IPage ListRegistrationAssignments( public RegistrationAssignment CreateOrUpdateRegistrationAssignment( string scope, string registrationDefinitionId, - Guid registrationAssignmentId = default(Guid)) + string registrationAssignmentId) { var registrationAssignment = new RegistrationAssignment { @@ -88,7 +87,7 @@ public RegistrationAssignment CreateOrUpdateRegistrationAssignment( return this.ManagedServicesClient.RegistrationAssignments.CreateOrUpdateAsync( scope: scope, - registrationAssignmentId: registrationAssignmentId.ToString(), + registrationAssignmentId: registrationAssignmentId, requestBody: registrationAssignment) .GetAwaiter() .GetResult(); @@ -112,11 +111,11 @@ public void RemoveRegistrationAssignment( public RegistrationDefinition CreateOrUpdateRegistrationDefinition( string scope, RegistrationDefinition registrationDefinition, - Guid registratonDefinitionId = default(Guid)) + string registratonDefinitionId) { return this.ManagedServicesClient.RegistrationDefinitions.CreateOrUpdateAsync( scope: scope, - registrationDefinitionId: registratonDefinitionId.ToString(), + registrationDefinitionId: registratonDefinitionId, requestBody: registrationDefinition) .GetAwaiter() .GetResult(); @@ -124,8 +123,7 @@ public RegistrationDefinition CreateOrUpdateRegistrationDefinition( public IPage ListRegistrationDefinitions(string scope) { - return this.ManagedServicesClient.RegistrationDefinitions.ListAsync( - scope: scope) + return this.ManagedServicesClient.RegistrationDefinitions.ListAsync(scope: scope) .GetAwaiter() .GetResult(); } diff --git a/src/ManagedServices/ManagedServices/Models/ManagedServicesCmdletBase.cs b/src/ManagedServices/ManagedServices/Models/ManagedServicesCmdletBase.cs index de0c5b42372f..61ecb2e50289 100644 --- a/src/ManagedServices/ManagedServices/Models/ManagedServicesCmdletBase.cs +++ b/src/ManagedServices/ManagedServices/Models/ManagedServicesCmdletBase.cs @@ -26,9 +26,10 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models /// public abstract class ManagedServicesCmdletBase : AzureRMCmdlet { - public string SubscriptionScopeStringFormat = "/subscriptions/{0}"; - public string RegistrationAssignmentFormat = "/{0}/providers/Microsoft.ManagedServices/registrationAssignments/{1}"; + public const string SubscriptionScopeStringFormat = "/subscriptions/{0}"; + private PSManagedServicesClient client; + public PSManagedServicesClient PSManagedServicesClient { get @@ -45,51 +46,23 @@ public PSManagedServicesClient PSManagedServicesClient } } - public string SubscriptionId - { - get - { - return DefaultContext.Subscription.Id; - } - } protected void WriteRegistrationAssignmentList(IPage assignments) { - if (assignments != null) - { - List output = new List(); - assignments.ForEach(assignment => output.Add(new PSRegistrationAssignment(assignment))); - WriteObject(output, true); - } + List output = new List(); + assignments?.ForEach(assignment => output.Add(new PSRegistrationAssignment(assignment))); + WriteObject(output, true); } protected void WriteRegistrationDefinitionsList(IPage definitions) { - if (definitions != null) - { - List output = new List(); - definitions.ForEach(definition => output.Add(new PSRegistrationDefinition(definition))); - WriteObject(output, true); - } + List output = new List(); + definitions?.ForEach(definition => output.Add(new PSRegistrationDefinition(definition))); + WriteObject(output, true); } public string GetDefaultScope() { - return string.Format(this.SubscriptionScopeStringFormat, DefaultContext.Subscription.Id); - } - - public string GetSubscriptionScope(string subscriptionId = null) - { - if (string.IsNullOrEmpty(subscriptionId)) - { - return GetDefaultScope(); - } - - if (!subscriptionId.IsGuid()) - { - throw new ApplicationException("subscriptionId must be a valid GUID."); - } - - return string.Format(this.SubscriptionScopeStringFormat, subscriptionId); + return string.Format(ManagedServicesCmdletBase.SubscriptionScopeStringFormat, DefaultContext.Subscription.Id); } } -} +} \ No newline at end of file diff --git a/src/ManagedServices/ManagedServices/Models/PSRegistrationAssignment.cs b/src/ManagedServices/ManagedServices/Models/PSRegistrationAssignment.cs index 34ca9d3facf1..174579990746 100644 --- a/src/ManagedServices/ManagedServices/Models/PSRegistrationAssignment.cs +++ b/src/ManagedServices/ManagedServices/Models/PSRegistrationAssignment.cs @@ -16,20 +16,18 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models { using Microsoft.Azure.Management.ManagedServices.Models; using Microsoft.WindowsAzure.Commands.Common.Attributes; - using System; - using System.Collections.Generic; - using System.Text; public class PSRegistrationAssignment { + [Ps1Xml(Label = "Id", Target = ViewControl.Table, Position = 1)] public string Id { get; set; } - public string Type { get; } + public string Type { get; set; } [Ps1Xml(Label = "Name", Target = ViewControl.Table, Position = 0)] public string Name { get; set; } - [Ps1Xml(Label = "RegistrationDefinitionId", Target = ViewControl.Table, ScriptBlock = "$_.Properties.RegistrationDefinitionId")] + [Ps1Xml(Label = "ProvisioningState", Target = ViewControl.Table, ScriptBlock = "$_.Properties.ProvisioningState", Position = 2)] public PSRegistrationAssignmentProperties Properties { get; set; } public PSRegistrationAssignment(RegistrationAssignment registrationAssignment) diff --git a/src/ManagedServices/ManagedServices/Models/PSRegistrationAssignmentProperties.cs b/src/ManagedServices/ManagedServices/Models/PSRegistrationAssignmentProperties.cs index 8429e2d7e77c..0050109a3c39 100644 --- a/src/ManagedServices/ManagedServices/Models/PSRegistrationAssignmentProperties.cs +++ b/src/ManagedServices/ManagedServices/Models/PSRegistrationAssignmentProperties.cs @@ -15,10 +15,6 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models { using Microsoft.Azure.Management.ManagedServices.Models; - using Microsoft.WindowsAzure.Commands.Common.Attributes; - using System; - using System.Collections.Generic; - using System.Text; public class PSRegistrationAssignmentProperties { @@ -30,9 +26,13 @@ public class PSRegistrationAssignmentProperties public PSRegistrationAssignmentProperties(RegistrationAssignmentProperties registrationAssignmentProperties) { - this.RegistrationDefinitionId = registrationAssignmentProperties.RegistrationDefinitionId; + this.RegistrationDefinitionId = registrationAssignmentProperties.RegistrationDefinitionId; this.ProvisioningState = registrationAssignmentProperties.ProvisioningState; - this.RegistrationDefinition = new PSRegistrationAssignmentPropertiesRegistrationDefinition(registrationAssignmentProperties.RegistrationDefinition); + + if (registrationAssignmentProperties.RegistrationDefinition != null) + { + this.RegistrationDefinition = new PSRegistrationAssignmentPropertiesRegistrationDefinition(registrationAssignmentProperties.RegistrationDefinition); + } } } } diff --git a/src/ManagedServices/ManagedServices/Models/PSRegistrationAssignmentPropertiesRegistrationDefinition.cs b/src/ManagedServices/ManagedServices/Models/PSRegistrationAssignmentPropertiesRegistrationDefinition.cs index 35b8c1855dbc..4e1cf2b8ae0d 100644 --- a/src/ManagedServices/ManagedServices/Models/PSRegistrationAssignmentPropertiesRegistrationDefinition.cs +++ b/src/ManagedServices/ManagedServices/Models/PSRegistrationAssignmentPropertiesRegistrationDefinition.cs @@ -13,7 +13,6 @@ // ---------------------------------------------------------------------------------- using Microsoft.Azure.Management.ManagedServices.Models; -using Microsoft.WindowsAzure.Commands.Common.Attributes; namespace Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models { diff --git a/src/ManagedServices/ManagedServices/Models/PSRegistrationAssignmentPropertiesRegistrationDefinitionProperties.cs b/src/ManagedServices/ManagedServices/Models/PSRegistrationAssignmentPropertiesRegistrationDefinitionProperties.cs index adb6a89474d3..bc75b0616914 100644 --- a/src/ManagedServices/ManagedServices/Models/PSRegistrationAssignmentPropertiesRegistrationDefinitionProperties.cs +++ b/src/ManagedServices/ManagedServices/Models/PSRegistrationAssignmentPropertiesRegistrationDefinitionProperties.cs @@ -13,7 +13,6 @@ // ---------------------------------------------------------------------------------- using Microsoft.Azure.Management.ManagedServices.Models; -using Microsoft.WindowsAzure.Commands.Common.Attributes; using System.Collections.Generic; namespace Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models diff --git a/src/ManagedServices/ManagedServices/Models/PSRegistrationDefinition.cs b/src/ManagedServices/ManagedServices/Models/PSRegistrationDefinition.cs index 17c5ad7e7ec7..7928d4f45132 100644 --- a/src/ManagedServices/ManagedServices/Models/PSRegistrationDefinition.cs +++ b/src/ManagedServices/ManagedServices/Models/PSRegistrationDefinition.cs @@ -14,19 +14,17 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models { - using System; using Microsoft.Azure.Management.ManagedServices.Models; using Microsoft.WindowsAzure.Commands.Common.Attributes; public class PSRegistrationDefinition { - [Ps1Xml(Label = "ManagedByTenantId", Target = ViewControl.Table, ScriptBlock = "$_.Properties.ManagedByTenantId", Position = 1)] - [Ps1Xml(Label = "PrincipalId", Target = ViewControl.Table, ScriptBlock = "$_.Properties.Authorization.PrincipalId", Position = 2)] - [Ps1Xml(Label = "RoleDefinitionId", Target = ViewControl.Table, ScriptBlock = "$_.Properties.Authorization.RoleDefinitionId", Position = 3)] + [Ps1Xml(Label = "ProvisioningState", Target = ViewControl.Table, ScriptBlock = "$_.Properties.ProvisioningState", Position = 2)] public PSRegistrationDefinitionProperties Properties { get; set; } public PSPlan Plan { get; set; } + [Ps1Xml(Label = "Id", Target = ViewControl.Table, Position = 1)] public string Id { get; set; } public string Type { get; set; } diff --git a/src/ManagedServices/ManagedServices/Models/PSRegistrationDefinitionProperties.cs b/src/ManagedServices/ManagedServices/Models/PSRegistrationDefinitionProperties.cs index f1ed2bffb823..5ab9ebfceac6 100644 --- a/src/ManagedServices/ManagedServices/Models/PSRegistrationDefinitionProperties.cs +++ b/src/ManagedServices/ManagedServices/Models/PSRegistrationDefinitionProperties.cs @@ -15,14 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models { using Microsoft.Azure.Management.ManagedServices.Models; - using Microsoft.WindowsAzure.Commands.Common.Attributes; using System.Collections.Generic; public class PSRegistrationDefinitionProperties { public string Description { get; set; } - public string Name { get; set; } + public string DisplayName { get; set; } public string ManagedByTenantId { get; set; } @@ -35,7 +34,7 @@ public class PSRegistrationDefinitionProperties public PSRegistrationDefinitionProperties(RegistrationDefinitionProperties registrationDefinitionProperties) { this.Description = registrationDefinitionProperties.Description; - this.Name = registrationDefinitionProperties.RegistrationDefinitionName; + this.DisplayName = registrationDefinitionProperties.RegistrationDefinitionName; this.ManagedByTenantId = registrationDefinitionProperties.ManagedByTenantId; this.ManagedByTenantName = registrationDefinitionProperties.ManagedByTenantName; this.ProvisioningState = registrationDefinitionProperties.ProvisioningState; diff --git a/src/ManagedServices/ManagedServices/help/Az.ManagedServices.md b/src/ManagedServices/ManagedServices/help/Az.ManagedServices.md index b187411da142..e12cf6ce8f39 100644 --- a/src/ManagedServices/ManagedServices/help/Az.ManagedServices.md +++ b/src/ManagedServices/ManagedServices/help/Az.ManagedServices.md @@ -1,31 +1,30 @@ --- Module Name: Az.ManagedServices -Module Guid: d2a8f744-8dcb-4a13-ba80-eb181ff365ad +Module Guid: fe0ae00c-c482-4e5f-a837-fbc342fdc7e0 Download Help Link: https://docs.microsoft.com/en-us/powershell/module/az.managedservices -Help Version: 0.0.1 +Help Version: 0.0.2 Locale: en-US --- # Az.ManagedServices Module ## Description -This feature is used by customers of Managed Service Providers (MSPs). Customers give an MSP the ability to manage their subscription. In addition to granting access, the customer can also remove access or view existing access delegations. MSPs are able to view the list of customers who have granted them access to subscriptions. There are two objects involved in this process: A registration definition which identifies the MSP and the role definitions granted to the MSP. The MSP can optionally define this object using a Managed Services marketplace offering Access assignments which associate a subscription with the definition. +This feature is used by customers of Managed Service Providers (MSPs). Customers give an MSP the ability to manage their subscription or resource group. In addition to granting access, the customer can also remove access or view existing access. MSPs are able to view the list of customers who have granted them access to subscriptions. There are two objects involved in this process: A registration definition which identifies the MSP and the role definitions granted to the MSP users. The MSP can optionally define this object using a Managed Services marketplace offering Access assignments which associate a subscription with the definition. ## Az.ManagedServices Cmdlets ### [Get-AzManagedServicesAssignment](Get-AzManagedServicesAssignment.md) -Gets a list of the registration assignments. +Gets a specific registration assignment or a list of the registration assignments. ### [Get-AzManagedServicesDefinition](Get-AzManagedServicesDefinition.md) -Gets a list of the registration definitions. +Gets a specific registration definition or a list of the registration definitions. ### [New-AzManagedServicesAssignment](New-AzManagedServicesAssignment.md) -Creates a registration assignment. +Creates or updates a registration assignment. ### [New-AzManagedServicesDefinition](New-AzManagedServicesDefinition.md) -Creates a registration definition. +Creates or updates a registration definition. ### [Remove-AzManagedServicesAssignment](Remove-AzManagedServicesAssignment.md) -Deletes the registration assignment. +Removes a registration assignment. ### [Remove-AzManagedServicesDefinition](Remove-AzManagedServicesDefinition.md) -Deletes the registration definition. - +Removes a registration definition. diff --git a/src/ManagedServices/ManagedServices/help/Get-AzManagedServicesAssignment.md b/src/ManagedServices/ManagedServices/help/Get-AzManagedServicesAssignment.md index 267df645dbbd..e59316cd7f6c 100644 --- a/src/ManagedServices/ManagedServices/help/Get-AzManagedServicesAssignment.md +++ b/src/ManagedServices/ManagedServices/help/Get-AzManagedServicesAssignment.md @@ -8,7 +8,7 @@ schema: 2.0.0 # Get-AzManagedServicesAssignment ## SYNOPSIS -Gets a list of the registration assignments. +Gets a specific registration assignment or a list of the registration assignments. ## SYNTAX @@ -18,126 +18,89 @@ Get-AzManagedServicesAssignment [-Scope ] [-ExpandRegistrationDefinition [-DefaultProfile ] [] ``` -### ById +### ByName ``` -Get-AzManagedServicesAssignment [-Scope ] -Id [-ExpandRegistrationDefinition] - [-DefaultProfile ] [] -``` - -### ByResourceId -``` -Get-AzManagedServicesAssignment -ResourceId [-ExpandRegistrationDefinition] +Get-AzManagedServicesAssignment [-Scope ] [-Name ] [-ExpandRegistrationDefinition] [-DefaultProfile ] [] ``` ## DESCRIPTION -Gets a list of the registration assignments. +Gets a specific registration assignment or a list of the registration assignments. ## EXAMPLES ### Example 1 -```powershell +``` PS C:\> Get-AzManagedServicesAssignment -Name RegistrationDefinitionId ----- ------------------------ -f2e18995-6c79-4ab7-876e-1b1c8393d12c /subscriptions/38bd4bef-41ff-45b5-b3af-d03e55a4ca15/providers/Microsoft.ManagedServices/registrationDefinitions/a156aad7-f3ce-4a46-b240-246242b6bd78 -ddd0d277-e120-4de1-8498-52b8f767b699 /subscriptions/38bd4bef-41ff-45b5-b3af-d03e55a4ca15/providers/Microsoft.ManagedServices/registrationDefinitions/cae481c0-de7c-42a8-86c1-5b170861caf8 +Name Id ProvisioningState +---- -- ----------------- +0413e647-6915-45e3-944d-79a587e57f80 /subscriptions/24ab6047-da91-48c0-66e5-20a8c6daefc8/providers/Microsoft.ManagedServices/registrationAssignments/0413e647-6915-45e3-944d-79a587e57f80 Succeeded + +PS C:\> ``` Gets all registration assignments under the default scope. ### Example 2 -```powershell +``` PS C:\> $assignments = Get-AzManagedServicesAssignment -ExpandRegistrationDefinition -PS C:\> $assignments - -Name RegistrationDefinitionId ----- ------------------------ -f2e18995-6c79-4ab7-876e-1b1c8393d12c /subscriptions/38bd4bef-41ff-45b5-b3af-d03e55a4ca15/providers/Microsoft.ManagedServices/registrationDefinitions/a156aad7-f3ce-4a46-b240-246242b6bd78 -8b6d4693-efb0-4b58-ac94-625b6a321af3 /subscriptions/38bd4bef-41ff-45b5-b3af-d03e55a4ca15/providers/Microsoft.ManagedServices/registrationDefinitions/bb2626be-3e11-442f-b0f1-9209508d4f52 -ddd0d277-e120-4de1-8498-52b8f767b699 /subscriptions/38bd4bef-41ff-45b5-b3af-d03e55a4ca15/providers/Microsoft.ManagedServices/registrationDefinitions/cae481c0-de7c-42a8-86c1-5b170861caf8 - - -PS C:\> $assignments[2].Properties.RegistrationDefinition +PS C:\> $assignments[0].Properties.RegistrationDefinition Properties : Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models.PSRegistrationAssignmentPropertiesRegistrationDefinitionProperties Plan : -Id : /subscriptions/38bd4bef-41ff-45b5-b3af-d03e55a4ca15/providers/Microsoft.ManagedServices/registrationDefinitions/cae481c0-de7c-42a8-86c1-5b170861caf8 +Id : /subscriptions/24ab6047-da91-48c0-66e5-20a8c6daefc8/providers/Microsoft.ManagedServices/registrationDefinitions/0c146106-c927-4098-a7ca-30bbcf44a502 Type : Microsoft.ManagedServices/registrationDefinitions -Name : cae481c0-de7c-42a8-86c1-5b170861caf8 +Name : 0c146106-c927-4098-a7ca-30bbcf44a502 + +PS C:\> ``` Gets all registration assignments with the registration definition details. ### Example 3 -```powershell -PS C:\> $assignmnent = Get-AzManagedServicesAssignment -Id ddd0d277-e120-4de1-8498-52b8f767b699 -PS C:\> $assignmnent - -Name RegistrationDefinitionId ----- ------------------------ -ddd0d277-e120-4de1-8498-52b8f767b699 /subscriptions/38bd4bef-41ff-45b5-b3af-d03e55a4ca15/providers/Microsoft.ManagedServices/registrationDefinitions/cae481c0-de7c-42a8-86c1-5b170861caf8 +``` +PS C:\> Get-AzManagedServicesAssignment -Name 0413e647-6915-45e3-944d-79a587e57f80 -PS C:\> $assignmnent.Properties.RegistrationDefinition +Name Id ProvisioningState +---- -- ----------------- +0413e647-6915-45e3-944d-79a587e57f80 /subscriptions/24ab6047-da91-48c0-66e5-20a8c6daefc8/providers/Microsoft.ManagedServices/registrationAssignments/0413e647-6915-45e3-944d-79a587e57f80 Succeeded -Properties : -Plan : -Id : -Type : -Name : +PS C:\> ``` -Gets a registration assignment without the registration definition details. +Gets a registration assignment by name without registration definition details. ### Example 4 -```powershell -PS C:\> $assignmnentWithDef = Get-AzManagedServicesAssignment -Id ddd0d277-e120-4de1-8498-52b8f767b699 -ExpandRegistrationDefinition -PS C:\> $assignmnentWithDef - -Name RegistrationDefinitionId ----- ------------------------ -ddd0d277-e120-4de1-8498-52b8f767b699 /subscriptions/38bd4bef-41ff-45b5-b3af-d03e55a4ca15/providers/Microsoft.ManagedServices/registrationDefinitions/cae481c0-de7c-42a8-86c1-5b170861caf8 - - -PS C:\> $assignmnentWithDef.Properties.RegistrationDefinition +``` +PS C:\> $assignment = Get-AzManagedServicesAssignment -Name 0413e647-6915-45e3-944d-79a587e57f80 -ExpandRegistrationDefinition +PS C:\> $assignment.Properties.RegistrationDefinition Properties : Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models.PSRegistrationAssignmentPropertiesRegistrationDefinitionProperties Plan : -Id : /subscriptions/38bd4bef-41ff-45b5-b3af-d03e55a4ca15/providers/Microsoft.ManagedServices/registrationDefinitions/cae481c0-de7c-42a8-86c1-5b170861caf8 +Id : /subscriptions/24ab6047-da91-48c0-66e5-20a8c6daefc8/providers/Microsoft.ManagedServices/registrationDefinitions/0c146106-c927-4098-a7ca-30bbcf44a502 Type : Microsoft.ManagedServices/registrationDefinitions -Name : cae481c0-de7c-42a8-86c1-5b170861caf8 +Name : 0c146106-c927-4098-a7ca-30bbcf44a502 + +PS C:\> ``` -Gets a registration assignment with registration definition details. +Gets a registration assignment by name with registration definition details. ### Example 5 -```powershell -PS C:\> Get-AzManagedServicesAssignment -Scope /subscriptions/38bd4bef-41ff-45b5-b3af-d03e55a4ca15/resourceGroups/newRG - -Name RegistrationDefinitionId ----- ------------------------ -c5deb1ba-8e27-4935-8af5-9242e7dabd24 /subscriptions/38bd4bef-41ff-45b5-b3af-d03e55a4ca15/providers/Microsoft.ManagedServices/registrationDefinitions/447b1aff-b0fc-4959-989d-d77dc93f3509 -aa891268-329a-4637-b3f6-2877ea304f8b /subscriptions/38bd4bef-41ff-45b5-b3af-d03e55a4ca15/providers/Microsoft.ManagedServices/registrationDefinitions/46b981a7-63ff-4063-9961-9fce4ddea376 ``` +PS C:\> Get-AzManagedServicesAssignment -Scope /subscriptions/24ab6047-da91-48c0-66e5-20a8c6daefc8 -Gets all the registration assignments. - -### Example 6 -```powershell -PS C:\> $assignments = Get-AzManagedServicesAssignment -PS C:\> $assignments[0].Id -/subscriptions/38bd4bef-41ff-45b5-b3af-d03e55a4ca15/providers/Microsoft.ManagedServices/registrationAssignments/f2e18995-6c79-4ab7-876e-1b1c8393d12c -PS C:\> Get-AzManagedServicesAssignment -ResourceId $assignments[0].Id +Name Id ProvisioningState +---- -- ----------------- +0413e647-6915-45e3-944d-79a587e57f80 /subscriptions/24ab6047-da91-48c0-66e5-20a8c6daefc8/providers/Microsoft.ManagedServices/registrationAssignments/0413e647-6915-45e3-944d-79a587e57f80 Succeeded -Name RegistrationDefinitionId ----- ------------------------ -f2e18995-6c79-4ab7-876e-1b1c8393d12c /subscriptions/38bd4bef-41ff-45b5-b3af-d03e55a4ca15/providers/Microsoft.ManagedServices/registrationDefinitions/a156aad7-f3ce-4a46-b240-246242b6bd78 +PS C:\> ``` -Gets the registration assignment given the fully qualified resource id. +Gets all the registration assignments at given scope. ## PARAMETERS @@ -166,45 +129,32 @@ Aliases: Required: False Position: Named -Default value: None +Default value: False Accept pipeline input: False Accept wildcard characters: False ``` -### -Id -The Registration Assignment identifier (for example, b0c052e5-c437-4771-a476-8b1201158a57). -```yaml -Type: System.String -Parameter Sets: ById -Aliases: - -Required: True -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` +### -Name +The unique name of the Registration Assignment. -### -ResourceId -The Registration Assignment ResourceId (for example, /subscriptions/bb6d49b2-603d-489f-b6ca-ca4dc497c749/providers/Microsoft.ManagedServices/registrationAssignments/b0c052e5-c437-4771-a476-8b1201158a57) ```yaml Type: System.String -Parameter Sets: ByResourceId +Parameter Sets: ByName Aliases: -Required: True +Required: False Position: Named Default value: None -Accept pipeline input: True (ByPropertyName) +Accept pipeline input: False Accept wildcard characters: False ``` ### -Scope -The scope where the registration assignment is created. +The scope where the registration assignment created. ```yaml Type: System.String -Parameter Sets: Default, ById +Parameter Sets: (All) Aliases: Required: False @@ -220,11 +170,9 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## INPUTS ### None - ## OUTPUTS ### Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models.PSRegistrationAssignment - ## NOTES ## RELATED LINKS diff --git a/src/ManagedServices/ManagedServices/help/Get-AzManagedServicesDefinition.md b/src/ManagedServices/ManagedServices/help/Get-AzManagedServicesDefinition.md index b6aa77e63848..3ddc6f9ae89d 100644 --- a/src/ManagedServices/ManagedServices/help/Get-AzManagedServicesDefinition.md +++ b/src/ManagedServices/ManagedServices/help/Get-AzManagedServicesDefinition.md @@ -8,71 +8,65 @@ schema: 2.0.0 # Get-AzManagedServicesDefinition ## SYNOPSIS -Gets a list of the registration definitions. +Gets a specific registration definition or a list of the registration definitions. ## SYNTAX -### Default (Default) +### ByName (Default) ``` -Get-AzManagedServicesDefinition [-DefaultProfile ] [] -``` - -### ById -``` -Get-AzManagedServicesDefinition -Id [-DefaultProfile ] [] +Get-AzManagedServicesDefinition [-Scope ] [-Name ] [-DefaultProfile ] + [] ``` -### ByResourceId +### Default ``` -Get-AzManagedServicesDefinition -ResourceId [-DefaultProfile ] +Get-AzManagedServicesDefinition [-Scope ] [-DefaultProfile ] [] ``` ## DESCRIPTION -Gets a list of the registration definitions. +Gets a specific registration definition or a list of the registration definitions. ## EXAMPLES ### Example 1 -```powershell +``` PS C:\> Get-AzManagedServicesDefinition -Name ManagedByTenantId PrincipalId RoleDefinitionId ----- ----------------- ----------- ---------------- -fff287a4-1714-4a17-bc40-a17ca8e69e3f bab3375b-6197-4a15-a44b-16c41faa91d7 d6f6c88a-5b7a-455e-ba40-ce146d4d3671 acdd72a7-3385-48ef-bd42-f606fba81ae7 -ee7e40e8-bc3f-4624-b0ca-d5364635b141 bab3375b-6197-4a15-a44b-16c41faa91d7 d6f6c88a-5b7a-455e-ba40-ce146d4d3671 acdd72a7-3385-48ef-bd42-f606fba81ae7 -e2ddcd3c-d50f-4d51-afd9-f9132fcae4e7 bab3375b-6197-4a15-a44b-16c41faa91d7 d6f6c88a-5b7a-455e-ba40-ce146d4d3671 acdd72a7-3385-48ef-bd42-f606fba81ae7 -d3301f65-7087-438c-a6bc-4b7ead094889 bab3375b-6197-4a15-a44b-16c41faa91d7 d6f6c88a-5b7a-455e-ba40-ce146d4d3671 acdd72a7-3385-48ef-bd42-f606fba81ae7 -cae481c0-de7c-42a8-86c1-5b170861caf8 bab3375b-6197-4a15-a44b-16c41faa91d7 {d6f6c88a-5b7a-455e-ba40-ce146d4d3671, d6f6c88a-5b7a-455e-ba40-ce146d4d3671} {acdd72a7-3385-48ef-bd42-f606fba81ae7, b24988ac-6180-42a0-ab88-20f7382dd24c} -bb2626be-3e11-442f-b0f1-9209508d4f52 bab3375b-6197-4a15-a44b-16c41faa91d7 d6f6c88a-5b7a-455e-ba40-ce146d4d3671 acdd72a7-3385-48ef-bd42-f606fba81ae7 +Name Id ProvisioningState +---- -- ----------------- +0c146106-c927-4098-a7ca-30bbcf44a502 /subscriptions/24ab6047-da91-48c0-66e5-20a8c6daefc8/providers/Microsoft.ManagedServices/registrationDefinitions/0c146106-c927-4098-a7ca-30bbcf44a502 Succeeded + +PS C:\> ``` -Gets all registration definitions. +Gets all registration definitions at default scope. ### Example 2 -```powershell -PS C:\> Get-AzManagedServicesDefinition -Id fff287a4-1714-4a17-bc40-a17ca8e69e3f +``` +PS C:\> Get-AzManagedServicesDefinition -Name 0c146106-c927-4098-a7ca-30bbcf44a502 + +Name Id ProvisioningState +---- -- ----------------- +0c146106-c927-4098-a7ca-30bbcf44a502 /subscriptions/24ab6047-da91-48c0-66e5-20a8c6daefc8/providers/Microsoft.ManagedServices/registrationDefinitions/0c146106-c927-4098-a7ca-30bbcf44a502 Succeeded -Name ManagedByTenantId PrincipalId RoleDefinitionId ----- ----------------- ----------- ---------------- -fff287a4-1714-4a17-bc40-a17ca8e69e3f bab3375b-6197-4a15-a44b-16c41faa91d7 d6f6c88a-5b7a-455e-ba40-ce146d4d3671 acdd72a7-3385-48ef-bd42-f606fba81ae7 +PS C:\> ``` -Gets the registration definition given its id. +Gets the registration definition by name at default scope. ### Example 3 -```powershell -PS C:\> $definitions = Get-AzManagedServicesDefinition -PS C:\> $definitions[0].Id -/subscriptions/38bd4bef-41ff-45b5-b3af-d03e55a4ca15/providers/Microsoft.ManagedServices/registrationDefinitions/fff287a4-1714-4a17-bc40-a17ca8e69e3f -PS C:\> Get-AzManagedServicesDefinition -ResourceId $definitions[0].Id - -Name ManagedByTenantId PrincipalId RoleDefinitionId ----- ----------------- ----------- ---------------- -fff287a4-1714-4a17-bc40-a17ca8e69e3f bab3375b-6197-4a15-a44b-16c41faa91d7 d6f6c88a-5b7a-455e-ba40-ce146d4d3671 acdd72a7-3385-48ef-bd42-f606fba81ae7 ``` +PS C:\> Get-AzManagedServicesDefinition -Scope /subscriptions/24ab6047-da91-48c0-66e5-20a8c6daefc8 -Gets the registration definition given the fully qualified resource id. +Name Id ProvisioningState +---- -- ----------------- +0c146106-c927-4098-a7ca-30bbcf44a502 /subscriptions/24ab6047-da91-48c0-66e5-20a8c6daefc8/providers/Microsoft.ManagedServices/registrationDefinitions/0c146106-c927-4098-a7ca-30bbcf44a502 Succeeded + +PS C:\> +``` + +Gets all registration definitions at the given scope. ## PARAMETERS @@ -91,31 +85,33 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -Id -The registration definition identifier (for example, b0c052e5-c437-4771-a476-8b1201158a57). +### -Name +The unique name of the Registration Definition. + ```yaml Type: System.String -Parameter Sets: ById +Parameter Sets: ByName Aliases: -Required: True +Required: False Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False ``` -### -ResourceId -The fully qualified resource id of the registration definition (for example, /subscriptions/bb6d49b2-603d-489f-b6ca-ca4dc497c749/providers/Microsoft.ManagedServices/registrationDefinitions/b0c052e5-c437-4771-a476-8b1201158a57) +### -Scope +The scope where the registration definition created. + ```yaml Type: System.String -Parameter Sets: ByResourceId +Parameter Sets: (All) Aliases: -Required: True +Required: False Position: Named Default value: None -Accept pipeline input: True (ByPropertyName) +Accept pipeline input: False Accept wildcard characters: False ``` @@ -125,11 +121,9 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## INPUTS ### None - ## OUTPUTS ### Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models.PSRegistrationDefinition - ## NOTES ## RELATED LINKS diff --git a/src/ManagedServices/ManagedServices/help/New-AzManagedServicesAssignment.md b/src/ManagedServices/ManagedServices/help/New-AzManagedServicesAssignment.md index 886d8f2c1c19..49182e460e02 100644 --- a/src/ManagedServices/ManagedServices/help/New-AzManagedServicesAssignment.md +++ b/src/ManagedServices/ManagedServices/help/New-AzManagedServicesAssignment.md @@ -14,20 +14,15 @@ Creates or updates a registration assignment. ### Default (Default) ``` -New-AzManagedServicesAssignment [[-Scope] ] -RegistrationDefinitionName [-AsJob] - [-DefaultProfile ] [-WhatIf] [-Confirm] [] -``` - -### ByResourceId -``` -New-AzManagedServicesAssignment [[-Scope] ] -RegistrationDefinitionId [-AsJob] +New-AzManagedServicesAssignment [-Name ] [-Scope ] -RegistrationDefinitionId [-AsJob] [-DefaultProfile ] [-WhatIf] [-Confirm] [] ``` ### ByInputObject ``` -New-AzManagedServicesAssignment [[-Scope] ] -RegistrationDefinition [-AsJob] - [-DefaultProfile ] [-WhatIf] [-Confirm] [] +New-AzManagedServicesAssignment [-Name ] [-Scope ] + -RegistrationDefinition [-AsJob] [-DefaultProfile ] [-WhatIf] + [-Confirm] [] ``` ## DESCRIPTION @@ -36,46 +31,81 @@ Creates or updates a registration assignment. ## EXAMPLES ### Example 1 -```powershell -PS C:\> New-AzManagedServicesAssignment -RegistrationDefinitionId /subscriptions/38bd4bef-41ff-45b5-b3af-d03e55a4ca15/providers/Microsoft.ManagedServices/registrationDefinitions/d4d14a4c-9b54-4dc3-b755-6d0659e0224b +``` +PS C:\> $definition = Get-AzManagedServicesDefinition +PS C:\> $definition + +Name Id ProvisioningState +---- -- ----------------- +55a89269-0347-4a9c-a778-c3f37b9f8672 /subscriptions/24ab6047-da91-48c0-66e5-20a8c6daefc8/providers/Microsoft.ManagedServices/registrationDefinitions/55a89269-0347-4a9c-a778-c3f37b9f8672 Succeeded + +PS C:\> New-AzManagedServicesAssignment -RegistrationDefinitionId /subscriptions/24ab6047-da91-48c0-66e5-20a8c6daefc8/providers/Microsoft.ManagedServices/registrationDefinitions/55a89269-0347-4a9c-a778-c3f37b9f8672 -Name RegistrationDefinitionId ----- ------------------------ -3b3d5411-ec8c-4a52-8972-73f4952724b2 /subscriptions/38bd4bef-41ff-45b5-b3af-d03e55a4ca15/providers/Microsoft.ManagedServices/registrationDefinitions/d4d14a4c-9b54-4dc3-b755-6d0659e0224b +Name Id ProvisioningState +---- -- ----------------- +12b05f0f-3426-48da-9e67-738e1dbf775f /subscriptions/24ab6047-da91-48c0-66e5-20a8c6daefc8/providers/Microsoft.ManagedServices/registrationAssignments/12b05f0f-3426-48da-9e67-738e1dbf775f Succeeded + + +PS C:\> ``` -Creates a new registration assignment given the fully qualified resource id of the registration definition. +Creates a registration assignment at the default scope using the registration definition identifier. ### Example 2 -```powershell -New-AzManagedServicesAssignment -Scope /subscriptions/38bd4bef-41ff-45b5-b3af-d03e55a4ca15/resourceGroups/mygroup1 -RegistrationDefinitionName 47f471b3-ff5f-463c-8a1f-286501b01ddc +``` +PS C:\> $auths = @( +>> [Microsoft.Azure.Management.ManagedServices.Models.Authorization]@{RoleDefinitionId = "acdd72a7-3385-48ef-bd42-f606fba81ae7"; PrincipalId = "714160ec-87d5-42bb-8b17-287c0dd7417d" } +>> ); +PS C:\> $definition = New-AzManagedServicesDefinition -DisplayName "MyTestDefinition" -ManagedByTenantId 72f9acbf-86f1-41af-91ab-2d7ef011db47 -Authorization $auths +PS C:\> $definition + +Name Id ProvisioningState +---- -- ----------------- +55a89269-0347-4a9c-a778-c3f37b9f8672 /subscriptions/24ab6047-da91-48c0-66e5-20a8c6daefc8/providers/Microsoft.ManagedServices/registrationDefinitions/55a89269-0347-4a9c-a778-c3f37b9f8672 Succeeded + + +PS C:\> New-AzManagedServicesAssignment -RegistrationDefinition $definition + +Name Id ProvisioningState +---- -- ----------------- +b279ec53-b42f-4952-bd62-cd49982e9572 /subscriptions/24ab6047-da91-48c0-66e5-20a8c6daefc8/providers/Microsoft.ManagedServices/registrationAssignments/b279ec53-b42f-4952-bd62-cd49982e9572 Succeeded -Name RegistrationDefinitionId ----- ------------------------ -5aa0d921-64b8-40e8-af33-31993f0deaa8 /subscriptions/38bd4bef-41ff-45b5-b3af-d03e55a4ca15/providers/Microsoft.ManagedServices/registrationDefinitions/47f471b3-ff5f-463c-8a1f-286501b01ddc + +PS C:\> ``` -Creates a the registration assignment given a scope and the registration definition name. +Creates a registration assignment with a registration definition object as input. ### Example 3 -```powershell -PS C:\> $def = New-AzManagedServicesDefinition -RegistrationDefinitionName asd -ManagedByTenantId "bab3375b-6197-4a15-a44b-16c41faa91d7" -PrincipalId "d6f6c88a-5b7a-455e-ba40-ce146d4d3671" -RoleDefinitionId "acdd72a7-3385-48ef-bd42-f606fba81ae7" -PS C:\> New-AzManagedServicesAssignment -RegistrationDefinition $def +``` +PS C:\> New-AzManagedServicesAssignment -RegistrationDefinitionId /subscriptions/24ab6047-da91-48c0-66e5-20a8c6daefc8/providers/Microsoft.ManagedServices/registrationDefinitions/55a89269-0347-4a9c-a778-c3f37b9f8672 + +Name Id ProvisioningState +---- -- ----------------- +12b05f0f-3426-48da-9e67-738e1dbf775f /subscriptions/24ab6047-da91-48c0-66e5-20a8c6daefc8/providers/Microsoft.ManagedServices/registrationAssignments/12b05f0f-3426-48da-9e67-738e1dbf775f Succeeded + -Name RegistrationDefinitionId ----- ------------------------ -a25f63d9-605c-4878-99bd-0d315480d46b /subscriptions/38bd4bef-41ff-45b5-b3af-d03e55a4ca15/providers/Microsoft.ManagedServices/registrationDefinitions/4a50f8eb-96b3-44c4-a397-e1e57035fe65 +PS C:\> New-AzManagedServicesAssignment -RegistrationDefinitionId /subscriptions/24ab6047-da91-48c0-66e5-20a8c6daefc8/providers/Microsoft.ManagedServices/registrationDefinitions/55a89269-0347-4a9c-a778-c3f37b9f8672 -Name 12b05f0f-3426-48da-9e67-738e1dbf775f + +Name Id ProvisioningState +---- -- ----------------- +12b05f0f-3426-48da-9e67-738e1dbf775f /subscriptions/24ab6047-da91-48c0-66e5-20a8c6daefc8/providers/Microsoft.ManagedServices/registrationAssignments/12b05f0f-3426-48da-9e67-738e1dbf775f Succeeded + +PS C:\> ``` -Creates a the registration assignment given a registration definition object. + +Updates a registration assignment with a registration definition identifier and name. + + ## PARAMETERS -### -AsJob -Run cmdlet in the background +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. ```yaml -Type: System.Management.Automation.SwitchParameter +Type: Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer Parameter Sets: (All) -Aliases: +Aliases: AzContext, AzureRmContext, AzureCredential Required: False Position: Named @@ -84,13 +114,13 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -DefaultProfile -The credentials, account, tenant, and subscription used for communication with Azure. +### -Name +The unique name of the Registration Assignment. ```yaml -Type: Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer +Type: System.String Parameter Sets: (All) -Aliases: AzContext, AzureRmContext, AzureCredential +Aliases: Required: False Position: Named @@ -114,13 +144,13 @@ Accept pipeline input: True (ByValue) Accept wildcard characters: False ``` -### -RegistrationDefinitionResourceId -The fully qualified resource id of the registration definition (for example, /subscriptions/bb6d49b2-603d-489f-b6ca-ca4dc497c749/providers/Microsoft.ManagedServices/registrationDefinitions/b0c052e5-c437-4771-a476-8b1201158a57). +### -RegistrationDefinitionId +The fully qualified resource id of the registration definition. ```yaml Type: System.String -Parameter Sets: ByResourceId -Aliases: ResourceId +Parameter Sets: Default +Aliases: Required: True Position: Named @@ -129,31 +159,31 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` -### -RegistrationDefinitionName -The registration definition name (for example, b0c052e5-c437-4771-a476-8b1201158a57. +### -Scope +The scope where the registration assignment should be created. ```yaml Type: System.String -Parameter Sets: Default +Parameter Sets: (All) Aliases: -Required: True +Required: False Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False ``` -### -Scope -The scope where the registration assignment should be created. +### -AsJob +Run cmdlet in the background ```yaml -Type: System.String +Type: System.Management.Automation.SwitchParameter Parameter Sets: (All) Aliases: Required: False -Position: 0 +Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -169,7 +199,7 @@ Aliases: cf Required: False Position: Named -Default value: None +Default value: False Accept pipeline input: False Accept wildcard characters: False ``` @@ -185,7 +215,7 @@ Aliases: wi Required: False Position: Named -Default value: None +Default value: False Accept pipeline input: False Accept wildcard characters: False ``` @@ -195,12 +225,11 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## INPUTS -### None - +### Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models.PSRegistrationDefinition +### System.String ## OUTPUTS ### Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models.PSRegistrationAssignment - ## NOTES ## RELATED LINKS diff --git a/src/ManagedServices/ManagedServices/help/New-AzManagedServicesDefinition.md b/src/ManagedServices/ManagedServices/help/New-AzManagedServicesDefinition.md index de36e34616e9..8cf7b3147dff 100644 --- a/src/ManagedServices/ManagedServices/help/New-AzManagedServicesDefinition.md +++ b/src/ManagedServices/ManagedServices/help/New-AzManagedServicesDefinition.md @@ -14,17 +14,24 @@ Creates or updates a registration definition. ### Default (Default) ``` -New-AzManagedServicesDefinition -Name -ManagedByTenantId - -PrincipalId -RoleDefinitionId [-Description ] [-AsJob] +New-AzManagedServicesDefinition [-Name ] -DisplayName -ManagedByTenantId + [-Description ] -PrincipalId -RoleDefinitionId [-AsJob] [-DefaultProfile ] [-WhatIf] [-Confirm] [] ``` ### ByPlan ``` -New-AzManagedServicesDefinition -Name -ManagedByTenantId - -PrincipalId -RoleDefinitionId [-Description ] -PlanName - -PlanPublisher -PlanProduct -PlanVersion [-AsJob] - [-DefaultProfile ] [-WhatIf] [-Confirm] [] +New-AzManagedServicesDefinition [-Name ] -DisplayName -ManagedByTenantId + [-Description ] -Authorization -PlanName -PlanPublisher + -PlanProduct -PlanVersion [-AsJob] [-DefaultProfile ] [-WhatIf] [-Confirm] + [] +``` + +### ByAuthorization +``` +New-AzManagedServicesDefinition [-Name ] -DisplayName -ManagedByTenantId + [-Description ] -Authorization [-AsJob] [-DefaultProfile ] [-WhatIf] + [-Confirm] [] ``` ## DESCRIPTION @@ -33,38 +40,77 @@ Creates or updates a registration definition. ## EXAMPLES ### Example 1 -```powershell -PS C:\> PS C:\> New-AzManagedServicesDefinition -Name name -ManagedByTenantId bab3375b-6197-4a15-a44b-16c41faa91d7 -PrincipalId d6f6c88a-5b7a-455e-ba40-ce146d4d3671 -RoleDefinitionId acdd72a7-3385-48ef-bd42-f606fba81ae7 -Description mydef +``` +PS C:\> New-AzManagedServicesDefinition -DisplayName "MyTestDefinition" -ManagedByTenantId 72f9acbf-86f1-41af-91ab-2d7ef011db47 -RoleDefinitionId acdd72a7-3385-48ef-bd42-f606fba81ae7 -PrincipalId 714160ec-87d5-42bb-8b17-287c0dd7417d -Name ManagedByTenantId PrincipalId RoleDefinitionId ----- ----------------- ----------- ---------------- -fdad02a1-a715-4352-844f-2923233590da bab3375b-6197-4a15-a44b-16c41faa91d7 d6f6c88a-5b7a-455e-ba40-ce146d4d3671 acdd72a7-3385-48ef-bd42-f606fba81ae7 +Name Id ProvisioningState +---- -- ----------------- +b732e39c-c034-44cd-b5a1-094669ccc8c5 /subscriptions/24ab6047-da91-48c0-66e5-20a8c6daefc8/providers/Microsoft.ManagedServices/registrationDefinitions/b732e39c-c034-44cd-b5a1-094669ccc8c5 Succeeded + + +PS C:\> ``` -Creates or updates a registration definition given the required parameters. +Creates a registration definition by roleDefinitionId and principalId values given directly. ### Example 2 -```powershell -PS C> New-AzManagedServicesDefinition -Name asd -ManagedByTenantId "bab3375b-6197-4a15-a44b-16c41faa91d7" -PrincipalId "d6f6c88a-5b7a-455e-ba40-ce146d4d3671" -RoleDefinitionId "acdd72a7-3385-48ef-bd42-f606fba81ae7" -PlanName plan -PlanPublisher publisher -PlanProduct product -PlanVersion 0.1 +``` +PS C:\> $auths = @( +>> [Microsoft.Azure.Management.ManagedServices.Models.Authorization]@{RoleDefinitionId = "acdd72a7-3385-48ef-bd42-f606fba81ae7"; PrincipalId = "714160ec-87d5-42bb-8b17-287c0dd7417d" } +>> ); +PS C:\> $definition = New-AzManagedServicesDefinition -DisplayName "MyTestDefinition" -ManagedByTenantId 72f9acbf-86f1-41af-91ab-2d7ef011db47 -Authorization $auths +PS C:\> $definition + +Name Id ProvisioningState +---- -- ----------------- +55a89269-0347-4a9c-a778-c3f37b9f8672 /subscriptions/24ab6047-da91-48c0-66e5-20a8c6daefc8/providers/Microsoft.ManagedServices/registrationDefinitions/55a89269-0347-4a9c-a778-c3f37b9f8672 Succeeded -Name ManagedByTenantId PrincipalId RoleDefinitionId ----- ----------------- ----------- ---------------- -8cde7c19-1750-468e-973e-b711549edc35 bab3375b-6197-4a15-a44b-16c41faa91d7 d6f6c88a-5b7a-455e-ba40-ce146d4d3671 acdd72a7-3385-48ef-bd42-f606fba81ae7 + +PS C:\> +``` + +Creates or updates a registration definition with authorization details. + +### Example 3 ``` +PS C:\> $auths = @( +>> [Microsoft.Azure.Management.ManagedServices.Models.Authorization]@{RoleDefinitionId = "acdd72a7-3385-48ef-bd42-f606fba81ae7"; PrincipalId = "714160ec-87d5-42bb-8b17-287c0dd7417d" }, +>> [Microsoft.Azure.Management.ManagedServices.Models.Authorization]@{RoleDefinitionId = "9980e02c-c2be-4d73-94e8-173b1dc7cf3c"; PrincipalId = "714160ec-87d5-42bb-8b17-287c0dd7417d" } +>> ); +PS C:\> $definition = Get-AzManagedServicesDefinition +PS C:\> $definition.Properties.Authorization -Creates or updates a registration definition with the plan details. +PrincipalId RoleDefinitionId +----------- ---------------- +714160ec-87d5-42bb-8b17-287c0dd7417d acdd72a7-3385-48ef-bd42-f606fba81ae7 + + +PS C:\> $definition.Name +55a89269-0347-4a9c-a778-c3f37b9f8672 +PS C:\> $definition = New-AzManagedServicesDefinition -DisplayName "MyTestDefinition" -ManagedByTenantId 72f9acbf-86f1-41af-91ab-2d7ef011db47 -Authorization $auths -Name 55a89269-0347-4a9c-a778-c3f37b9f8672 +PS C:\> $definition.Properties.Authorization + +PrincipalId RoleDefinitionId +----------- ---------------- +714160ec-87d5-42bb-8b17-287c0dd7417d acdd72a7-3385-48ef-bd42-f606fba81ae7 +714160ec-87d5-42bb-8b17-287c0dd7417d 9980e02c-c2be-4d73-94e8-173b1dc7cf3c + +PS C:\> +``` + +Updates a registration definition with authorization details and name of the registration definition. ## PARAMETERS -### -AsJob -Run cmdlet in the background +### -Authorization +The authorization mapping list with principalId - roleDefinitionId. ```yaml -Type: System.Management.Automation.SwitchParameter -Parameter Sets: (All) +Type: Microsoft.Azure.Management.ManagedServices.Models.Authorization[] +Parameter Sets: ByPlan, ByAuthorization Aliases: -Required: False +Required: True Position: Named Default value: None Accept pipeline input: False @@ -101,6 +147,21 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -DisplayName +The display name of the Registration Definition. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -ManagedByTenantId The ManagedBy Tenant Identifier. @@ -116,6 +177,21 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -Name +The unique name of the Registration Definition. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -PlanName The name of the plan. @@ -181,7 +257,7 @@ The ManagedBy Principal Identifier. ```yaml Type: System.String -Parameter Sets: (All) +Parameter Sets: Default Aliases: Required: True @@ -191,12 +267,12 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -RegistrationDefinitionName -The name of the Registration Definition. +### -RoleDefinitionId +The role definition identifier to grant permissions to principal identifier. ```yaml Type: System.String -Parameter Sets: (All) +Parameter Sets: Default Aliases: Required: True @@ -206,15 +282,15 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -RoleDefinitionId -The Managed Service Provider's Role Identifier. +### -AsJob +Run cmdlet in the background ```yaml -Type: System.String +Type: System.Management.Automation.SwitchParameter Parameter Sets: (All) Aliases: -Required: True +Required: False Position: Named Default value: None Accept pipeline input: False @@ -231,7 +307,7 @@ Aliases: cf Required: False Position: Named -Default value: None +Default value: False Accept pipeline input: False Accept wildcard characters: False ``` @@ -247,7 +323,7 @@ Aliases: wi Required: False Position: Named -Default value: None +Default value: False Accept pipeline input: False Accept wildcard characters: False ``` @@ -258,11 +334,9 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## INPUTS ### None - ## OUTPUTS ### Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models.PSRegistrationDefinition - ## NOTES ## RELATED LINKS diff --git a/src/ManagedServices/ManagedServices/help/Remove-AzManagedServicesAssignment.md b/src/ManagedServices/ManagedServices/help/Remove-AzManagedServicesAssignment.md index 3eff206dcc6e..6f323a3c002a 100644 --- a/src/ManagedServices/ManagedServices/help/Remove-AzManagedServicesAssignment.md +++ b/src/ManagedServices/ManagedServices/help/Remove-AzManagedServicesAssignment.md @@ -14,13 +14,7 @@ Deletes a registration assignment. ### Default (Default) ``` -Remove-AzManagedServicesAssignment [[-Scope] ] -Id [-AsJob] - [-DefaultProfile ] [-WhatIf] [-Confirm] [] -``` - -### ByResourceId -``` -Remove-AzManagedServicesAssignment -ResourceId [-AsJob] [-DefaultProfile ] +Remove-AzManagedServicesAssignment [-Scope ] -Name [-AsJob] [-DefaultProfile ] [-WhatIf] [-Confirm] [] ``` @@ -36,52 +30,57 @@ Deletes a registration assignment. ## EXAMPLES ### Example 1 -```powershell -PS C:\Remove-AzManagedServicesAssignment -Id b037e73c-815e-4472-868f-59e51b49b949 - -Name RegistrationDefinitionId ----- ------------------------ -b037e73c-815e-4472-868f-59e51b49b949 /subscriptions/38bd4bef-41ff-45b5-b3af-d03e55a4ca15/providers/Microsoft.ManagedServices/registrationDefinitions/be2f72e6-93e0-4d3f-ac50-9a756ed4ffa7 +``` +PS C:\> Remove-AzManagedServicesAssignment -Name 0413e647-6915-45e3-944d-79a587e57f80 +PS C:\> ``` -Deletes the registration assignment under the default scope. +Deletes the registration assignment by name at the default scope. ### Example 2 -```powershell -PS C:\> Remove-AzManagedServicesAssignment -ResourceId /subscriptions/38bd4bef-41ff-45b5-b3af-d03e55a4ca15/providers/Microsoft.ManagedServices/registrationAssignments/88ba878b-9a3c-40c3-80da-015cbe488a2f - -Name RegistrationDefinitionId ----- ------------------------ -88ba878b-9a3c-40c3-80da-015cbe488a2f /subscriptions/38bd4bef-41ff-45b5-b3af-d03e55a4ca15/providers/Microsoft.ManagedServices/registrationDefinitions/40be0299-6573-4391-be2f-b41dd4aaf4f9 ``` +PS C:\> New-AzManagedServicesAssignment -RegistrationDefinitionId /subscriptions/24ab6047-da91-48c0-66e5-20a8c6daefc8/providers/Microsoft.ManagedServices/registrationDefinitions/55a89269-0347-4a9c-a778-c3f37b9f8672 -Name 12b05f0f-3426-48da-9e67-738e1dbf775f -Deletes the registration assignment given the fully qualified resource id. +Name Id ProvisioningState +---- -- ----------------- +12b05f0f-3426-48da-9e67-738e1dbf775f /subscriptions/24ab6047-da91-48c0-66e5-20a8c6daefc8/providers/Microsoft.ManagedServices/registrationAssignments/12b05f0f-3426-48da-9e67-738e1dbf775f Succeeded -### Example 3 -```powershell -PS C:\> $assignment = New-AzManagedServicesAssignment -RegistrationDefinitionId /subscriptions/38bd4bef-41ff-45b5-b3af-d03e55a4ca15/providers/Microsoft.ManagedServices/registrationDefinitions/33974646-9bce-461d-89eb-331f20fca33c + +PS C:\> $assignment = Get-AzManagedServicesAssignment -Name 12b05f0f-3426-48da-9e67-738e1dbf775f PS C:\> Remove-AzManagedServicesAssignment -InputObject $assignment +PS C:\> ``` Deletes the registration assignment using the input object provided. -## PARAMETERS +### Example 3 +``` +PS C:\> $auths = @( +>> [Microsoft.Azure.Management.ManagedServices.Models.Authorization]@{RoleDefinitionId = "acdd72a7-3385-48ef-bd42-f606fba81ae7"; PrincipalId = "714160ec-87d5-42bb-8b17-287c0dd7417d" } +>> ); +PS C:\> $definition = New-AzManagedServicesDefinition -DisplayName "MyTestDefinition" -ManagedByTenantId 72f9acbf-86f1-41af-91ab-2d7ef011db47 -Authorization $auths +PS C:\> $definition -### -AsJob -Run cmdlet in the background +Name Id ProvisioningState +---- -- ----------------- +55a89269-0347-4a9c-a778-c3f37b9f8672 /subscriptions/24ab6047-da91-48c0-66e5-20a8c6daefc8/providers/Microsoft.ManagedServices/registrationDefinitions/55a89269-0347-4a9c-a778-c3f37b9f8672 Succeeded -```yaml -Type: System.Management.Automation.SwitchParameter -Parameter Sets: (All) -Aliases: -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False +PS C:\> New-AzManagedServicesAssignment -RegistrationDefinition $definition + +Name Id ProvisioningState +---- -- ----------------- +b279ec53-b42f-4952-bd62-cd49982e9572 /subscriptions/24ab6047-da91-48c0-66e5-20a8c6daefc8/providers/Microsoft.ManagedServices/registrationAssignments/b279ec53-b42f-4952-bd62-cd49982e9572 Succeeded + + +PS C:\> Remove-AzManagedServicesAssignment -Name b279ec53-b42f-4952-bd62-cd49982e9572 -Scope /subscriptions/24ab6047-da91-48c0-66e5-20a8c6daefc8 +PS C:\> ``` +Deletes the registration assignment by name at the given scope. + +## PARAMETERS + ### -DefaultProfile The credentials, account, tenant, and subscription used for communication with Azure. @@ -97,20 +96,6 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -Id -The registration assignment GUID (for example, b0c052e5-c437-4771-a476-8b1201158a57) -```yaml -Type: System.String -Parameter Sets: Default -Aliases: - -Required: True -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - ### -InputObject The registration assignment object. @@ -126,23 +111,23 @@ Accept pipeline input: True (ByValue) Accept wildcard characters: False ``` -### -ResourceId -The fully qualified resource id of the registration assignment (for example, /subscriptions/bb6d49b2-603d-489f-b6ca-ca4dc497c749/providers/Microsoft.ManagedServices/registrationAssignments/b0c052e5-c437-4771-a476-8b1201158a57). +### -Name +The unique name of the Registration Assignment. ```yaml Type: System.String -Parameter Sets: ByResourceId +Parameter Sets: Default Aliases: Required: True Position: Named Default value: None -Accept pipeline input: True (ByPropertyName) +Accept pipeline input: False Accept wildcard characters: False ``` ### -Scope -The scope where the registration assignment should be created. +The scope of the registration assignment. ```yaml Type: System.String @@ -150,7 +135,22 @@ Parameter Sets: Default Aliases: Required: False -Position: 0 +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AsJob +Run cmdlet in the background + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -166,7 +166,7 @@ Aliases: cf Required: False Position: Named -Default value: None +Default value: False Accept pipeline input: False Accept wildcard characters: False ``` @@ -182,7 +182,7 @@ Aliases: wi Required: False Position: Named -Default value: None +Default value: False Accept pipeline input: False Accept wildcard characters: False ``` @@ -192,14 +192,10 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## INPUTS -### System.String - ### Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models.PSRegistrationAssignment - ## OUTPUTS -### Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models.PSRegistrationDefinition - +### System.Void ## NOTES ## RELATED LINKS diff --git a/src/ManagedServices/ManagedServices/help/Remove-AzManagedServicesDefinition.md b/src/ManagedServices/ManagedServices/help/Remove-AzManagedServicesDefinition.md index d2b01aab2369..8fa7498f53c2 100644 --- a/src/ManagedServices/ManagedServices/help/Remove-AzManagedServicesDefinition.md +++ b/src/ManagedServices/ManagedServices/help/Remove-AzManagedServicesDefinition.md @@ -14,19 +14,13 @@ Deletes the registration definition. ### Default (Default) ``` -Remove-AzManagedServicesDefinition -Id [-AsJob] [-DefaultProfile ] [-WhatIf] - [-Confirm] [] -``` - -### ByResourceId -``` -Remove-AzManagedServicesDefinition -ResourceId [-AsJob] [-DefaultProfile ] +Remove-AzManagedServicesDefinition [-Scope ] -Name [-DefaultProfile ] [-WhatIf] [-Confirm] [] ``` ### ByInputObject ``` -Remove-AzManagedServicesDefinition -InputObject [-AsJob] +Remove-AzManagedServicesDefinition -InputObject [-DefaultProfile ] [-WhatIf] [-Confirm] [] ``` @@ -36,52 +30,24 @@ Deletes the registration definition. ## EXAMPLES ### Example 1 -```powershell -PS C:\> Remove-RegistrationDefinition -Id 0513b566-cab0-4fef-9b53-a285cd33389f +``` +PS C:\> Remove-AzManagedServicesDefinition -Name 0c146106-c927-4098-a7ca-30bbcf44a502 +PS C:\> ``` -Removes the registration definition given it identifier. +Removes the registration definition by name at the default scope. ### Example 2 -```powershell -PS C:\> Remove-AzManagedServicesDefinition -ResourceId /subscriptions/38bd4bef-41ff-45b5-b3af-d03e55a4ca15/providers/Microsoft.ManagedServices/registrationDefinitions/11b7c937-c5c1-4dd1-9a77-204591f93fcd - -Name ManagedByTenantId PrincipalId RoleDefinitionId ----- ----------------- ----------- ---------------- -11b7c937-c5c1-4dd1-9a77-204591f93fcd bab3375b-6197-4a15-a44b-16c41faa91d7 d6f6c88a-5b7a-455e-ba40-ce146d4d3671 acdd72a7-3385-48ef-bd42-f606fba81ae7 ``` - -Removes the registration definition given the fully qualified resource id. - -### Example 3 -```powershell -PS C:\> $def = New-AzManagedServicesDefinition -RegistrationDefinitionName 572e1807-b80b-4401-9128-1968f432a5ad -ManagedByTenantId "bab3375b-6197-4a15-a44b-16c41faa91d7" -PrincipalId "d6f6c88a-5b7a-455e-ba40-ce146d4d3671" -RoleDefinitionId "acdd72a7-3385-48ef-bd42-f606fba81ae7" -PS C:\> Remove-AzManagedServicesDefinition -InputObject $def - -Name ManagedByTenantId PrincipalId RoleDefinitionId ----- ----------------- ----------- ---------------- -eee59839-119f-453f-adec-4a72a8687125 bab3375b-6197-4a15-a44b-16c41faa91d7 d6f6c88a-5b7a-455e-ba40-ce146d4d3671 acdd72a7-3385-48ef-bd42-f606fba81ae7 +PS C:\> $definition = New-AzManagedServicesDefinition -DisplayName "MyTestDefinition" -ManagedByTenantId 72f9acbf-86f1-41af-91ab-2d7ef011db47 -RoleDefinitionId acdd72a7-3385-48ef-bd42-f606fba81ae7 -PrincipalId 714160ec-87d5-42bb-8b17-287c0dd7417d +PS C:\> Remove-AzManagedServicesDefinition -InputObject $definition +PS C:\> ``` -Deletes the registration definition given the object. +Deletes the registration definition given the input object. ## PARAMETERS -### -AsJob -Run cmdlet in the background - -```yaml -Type: System.Management.Automation.SwitchParameter -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - ### -DefaultProfile The credentials, account, tenant, and subscription used for communication with Azure. @@ -97,48 +63,48 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -Id -The registration definition identifier. +### -InputObject +The registration definition object. ```yaml -Type: System.String -Parameter Sets: Default +Type: Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models.PSRegistrationDefinition +Parameter Sets: ByInputObject Aliases: Required: True Position: Named Default value: None -Accept pipeline input: False +Accept pipeline input: True (ByValue) Accept wildcard characters: False ``` -### -InputObject -The registration definition object. +### -Name +The unique name of the Registration Definition. ```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models.PSRegistrationDefinition -Parameter Sets: ByInputObject +Type: System.String +Parameter Sets: Default Aliases: Required: True Position: Named Default value: None -Accept pipeline input: True (ByValue) +Accept pipeline input: False Accept wildcard characters: False ``` -### -ResourceId -ResourceId of the registration definition +### -Scope +The scope where the registration definition created. ```yaml Type: System.String -Parameter Sets: ByResourceId +Parameter Sets: Default Aliases: -Required: True +Required: False Position: Named Default value: None -Accept pipeline input: True (ByPropertyName) +Accept pipeline input: False Accept wildcard characters: False ``` @@ -152,7 +118,7 @@ Aliases: cf Required: False Position: Named -Default value: None +Default value: False Accept pipeline input: False Accept wildcard characters: False ``` @@ -168,7 +134,7 @@ Aliases: wi Required: False Position: Named -Default value: None +Default value: False Accept pipeline input: False Accept wildcard characters: False ``` @@ -178,12 +144,10 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## INPUTS -### None - -## OUTPUTS - ### Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models.PSRegistrationDefinition +## OUTPUTS +### System.Void ## NOTES ## RELATED LINKS diff --git a/tools/StaticAnalysis/Exceptions/Az.ManagedServices/BreakingChangeIssues.csv b/tools/StaticAnalysis/Exceptions/Az.ManagedServices/BreakingChangeIssues.csv new file mode 100644 index 000000000000..444f8924d939 --- /dev/null +++ b/tools/StaticAnalysis/Exceptions/Az.ManagedServices/BreakingChangeIssues.csv @@ -0,0 +1,34 @@ +"AssemblyFileName","ClassName","Target","Severity","ProblemId","Description","Remediation" +"Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.dll","Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Commands.GetAzureRmManagedServicesAssignment","Get-AzManagedServicesAssignment","0","2090","The ValidateNotNullOrEmpty attribute has been added to parameter 'Scope' for cmdlet 'Get-AzManagedServicesAssignment'.","Remove the ValidateNotNullOrEmpty attribute from parameter 'Scope'." +"Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.dll","Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Commands.GetAzureRmManagedServicesAssignment","Get-AzManagedServicesAssignment","0","2000","The cmdlet 'Get-AzManagedServicesAssignment' no longer supports the parameter 'Id' and no alias was found for the original parameter name.","Add the parameter 'Id' back to the cmdlet 'Get-AzManagedServicesAssignment', or add an alias to the original parameter name." +"Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.dll","Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Commands.GetAzureRmManagedServicesAssignment","Get-AzManagedServicesAssignment","0","2000","The cmdlet 'Get-AzManagedServicesAssignment' no longer supports the parameter 'ResourceId' and no alias was found for the original parameter name.","Add the parameter 'ResourceId' back to the cmdlet 'Get-AzManagedServicesAssignment', or add an alias to the original parameter name." +"Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.dll","Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Commands.GetAzureRmManagedServicesAssignment","Get-AzManagedServicesAssignment","0","1050","The parameter set 'ById' for cmdlet 'Get-AzManagedServicesAssignment' has been removed.","Add parameter set 'ById' back to cmdlet 'Get-AzManagedServicesAssignment'." +"Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.dll","Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Commands.GetAzureRmManagedServicesAssignment","Get-AzManagedServicesAssignment","0","1050","The parameter set 'ByResourceId' for cmdlet 'Get-AzManagedServicesAssignment' has been removed.","Add parameter set 'ByResourceId' back to cmdlet 'Get-AzManagedServicesAssignment'." +"Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.dll","Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Commands.GetAzureRmManagedServicesDefinition","Get-AzManagedServicesDefinition","0","3010","The property 'Name' of type 'Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models.PSRegistrationDefinitionProperties' has been removed.","Add the property 'Name' back to type 'Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models.PSRegistrationDefinitionProperties'." +"Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.dll","Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Commands.GetAzureRmManagedServicesDefinition","Get-AzManagedServicesDefinition","0","2000","The cmdlet 'Get-AzManagedServicesDefinition' no longer supports the parameter 'ResourceId' and no alias was found for the original parameter name.","Add the parameter 'ResourceId' back to the cmdlet 'Get-AzManagedServicesDefinition', or add an alias to the original parameter name." +"Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.dll","Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Commands.GetAzureRmManagedServicesDefinition","Get-AzManagedServicesDefinition","0","1050","The parameter set 'ByResourceId' for cmdlet 'Get-AzManagedServicesDefinition' has been removed.","Add parameter set 'ByResourceId' back to cmdlet 'Get-AzManagedServicesDefinition'." +"Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.dll","Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Commands.NewAzureRmManagedServicesAssignment","New-AzManagedServicesAssignment","0","2090","The ValidateNotNullOrEmpty attribute has been added to parameter 'Scope' for cmdlet 'New-AzManagedServicesAssignment'.","Remove the ValidateNotNullOrEmpty attribute from parameter 'Scope'." +"Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.dll","Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Commands.NewAzureRmManagedServicesAssignment","New-AzManagedServicesAssignment","0","2000","The cmdlet 'New-AzManagedServicesAssignment' no longer supports the parameter 'RegistrationDefinitionName' and no alias was found for the original parameter name.","Add the parameter 'RegistrationDefinitionName' back to the cmdlet 'New-AzManagedServicesAssignment', or add an alias to the original parameter name." +"Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.dll","Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Commands.NewAzureRmManagedServicesAssignment","New-AzManagedServicesAssignment","0","2000","The cmdlet 'New-AzManagedServicesAssignment' no longer supports the parameter 'RegistrationDefinitionResourceId' and no alias was found for the original parameter name.","Add the parameter 'RegistrationDefinitionResourceId' back to the cmdlet 'New-AzManagedServicesAssignment', or add an alias to the original parameter name." +"Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.dll","Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Commands.NewAzureRmManagedServicesAssignment","New-AzManagedServicesAssignment","0","1050","The parameter set 'Default' for cmdlet 'New-AzManagedServicesAssignment' has been removed.","Add parameter set 'Default' back to cmdlet 'New-AzManagedServicesAssignment'." +"Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.dll","Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Commands.NewAzureRmManagedServicesAssignment","New-AzManagedServicesAssignment","0","1050","The parameter set 'ByResourceId' for cmdlet 'New-AzManagedServicesAssignment' has been removed.","Add parameter set 'ByResourceId' back to cmdlet 'New-AzManagedServicesAssignment'." +"Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.dll","Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Commands.NewAzureRmManagedServicesAssignment","New-AzManagedServicesAssignment","0","1050","The parameter set 'ByInputObject' for cmdlet 'New-AzManagedServicesAssignment' has been removed.","Add parameter set 'ByInputObject' back to cmdlet 'New-AzManagedServicesAssignment'." +"Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.dll","Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Commands.NewAzureRmManagedServicesDefinition","New-AzManagedServicesDefinition","0","2090","The ValidateNotNullOrEmpty attribute has been added to parameter 'Name' for cmdlet 'New-AzManagedServicesDefinition'.","Remove the ValidateNotNullOrEmpty attribute from parameter 'Name'." +"Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.dll","Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Commands.NewAzureRmManagedServicesDefinition","New-AzManagedServicesDefinition","0","2090","The ValidateNotNullOrEmpty attribute has been added to parameter 'ManagedByTenantId' for cmdlet 'New-AzManagedServicesDefinition'.","Remove the ValidateNotNullOrEmpty attribute from parameter 'ManagedByTenantId'." +"Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.dll","Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Commands.NewAzureRmManagedServicesDefinition","New-AzManagedServicesDefinition","0","2090","The ValidateNotNullOrEmpty attribute has been added to parameter 'PrincipalId' for cmdlet 'New-AzManagedServicesDefinition'.","Remove the ValidateNotNullOrEmpty attribute from parameter 'PrincipalId'." +"Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.dll","Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Commands.NewAzureRmManagedServicesDefinition","New-AzManagedServicesDefinition","0","2090","The ValidateNotNullOrEmpty attribute has been added to parameter 'RoleDefinitionId' for cmdlet 'New-AzManagedServicesDefinition'.","Remove the ValidateNotNullOrEmpty attribute from parameter 'RoleDefinitionId'." +"Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.dll","Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Commands.NewAzureRmManagedServicesDefinition","New-AzManagedServicesDefinition","0","2090","The ValidateNotNullOrEmpty attribute has been added to parameter 'Description' for cmdlet 'New-AzManagedServicesDefinition'.","Remove the ValidateNotNullOrEmpty attribute from parameter 'Description'." +"Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.dll","Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Commands.NewAzureRmManagedServicesDefinition","New-AzManagedServicesDefinition","0","1050","The parameter set 'Default' for cmdlet 'New-AzManagedServicesDefinition' has been removed.","Add parameter set 'Default' back to cmdlet 'New-AzManagedServicesDefinition'." +"Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.dll","Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Commands.NewAzureRmManagedServicesDefinition","New-AzManagedServicesDefinition","0","1050","The parameter set 'ByPlan' for cmdlet 'New-AzManagedServicesDefinition' has been removed.","Add parameter set 'ByPlan' back to cmdlet 'New-AzManagedServicesDefinition'." +"Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.dll","Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Commands.RemoveAzureRmManagedServcicesAssignment","Remove-AzManagedServicesAssignment","0","2090","The ValidateNotNullOrEmpty attribute has been added to parameter 'Scope' for cmdlet 'Remove-AzManagedServicesAssignment'.","Remove the ValidateNotNullOrEmpty attribute from parameter 'Scope'." +"Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.dll","Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Commands.RemoveAzureRmManagedServcicesAssignment","Remove-AzManagedServicesAssignment","0","2000","The cmdlet 'Remove-AzManagedServicesAssignment' no longer supports the parameter 'Id' and no alias was found for the original parameter name.","Add the parameter 'Id' back to the cmdlet 'Remove-AzManagedServicesAssignment', or add an alias to the original parameter name." +"Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.dll","Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Commands.RemoveAzureRmManagedServcicesAssignment","Remove-AzManagedServicesAssignment","0","2000","The cmdlet 'Remove-AzManagedServicesAssignment' no longer supports the parameter 'ResourceId' and no alias was found for the original parameter name.","Add the parameter 'ResourceId' back to the cmdlet 'Remove-AzManagedServicesAssignment', or add an alias to the original parameter name." +"Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.dll","Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Commands.RemoveAzureRmManagedServcicesAssignment","Remove-AzManagedServicesAssignment","0","1050","The parameter set 'Default' for cmdlet 'Remove-AzManagedServicesAssignment' has been removed.","Add parameter set 'Default' back to cmdlet 'Remove-AzManagedServicesAssignment'." +"Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.dll","Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Commands.RemoveAzureRmManagedServcicesAssignment","Remove-AzManagedServicesAssignment","0","1050","The parameter set 'ByResourceId' for cmdlet 'Remove-AzManagedServicesAssignment' has been removed.","Add parameter set 'ByResourceId' back to cmdlet 'Remove-AzManagedServicesAssignment'." +"Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.dll","Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Commands.RemoveAzureRmManagedServicesDefinition","Remove-AzManagedServicesDefinition","0","2000","The cmdlet 'Remove-AzManagedServicesDefinition' no longer supports the parameter 'Id' and no alias was found for the original parameter name.","Add the parameter 'Id' back to the cmdlet 'Remove-AzManagedServicesDefinition', or add an alias to the original parameter name." +"Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.dll","Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Commands.RemoveAzureRmManagedServicesDefinition","Remove-AzManagedServicesDefinition","0","2000","The cmdlet 'Remove-AzManagedServicesDefinition' no longer supports the parameter 'ResourceId' and no alias was found for the original parameter name.","Add the parameter 'ResourceId' back to the cmdlet 'Remove-AzManagedServicesDefinition', or add an alias to the original parameter name." +"Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.dll","Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Commands.RemoveAzureRmManagedServicesDefinition","Remove-AzManagedServicesDefinition","0","2000","The cmdlet 'Remove-AzManagedServicesDefinition' no longer supports the parameter 'AsJob' and no alias was found for the original parameter name.","Add the parameter 'AsJob' back to the cmdlet 'Remove-AzManagedServicesDefinition', or add an alias to the original parameter name." +"Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.dll","Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Commands.RemoveAzureRmManagedServicesDefinition","Remove-AzManagedServicesDefinition","0","1050","The parameter set 'Default' for cmdlet 'Remove-AzManagedServicesDefinition' has been removed.","Add parameter set 'Default' back to cmdlet 'Remove-AzManagedServicesDefinition'." +"Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.dll","Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Commands.RemoveAzureRmManagedServicesDefinition","Remove-AzManagedServicesDefinition","0","1050","The parameter set 'ByResourceId' for cmdlet 'Remove-AzManagedServicesDefinition' has been removed.","Add parameter set 'ByResourceId' back to cmdlet 'Remove-AzManagedServicesDefinition'." +"Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.dll","Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Commands.RemoveAzureRmManagedServicesDefinition","Remove-AzManagedServicesDefinition","0","1050","The parameter set 'ByInputObject' for cmdlet 'Remove-AzManagedServicesDefinition' has been removed.","Add parameter set 'ByInputObject' back to cmdlet 'Remove-AzManagedServicesDefinition'." +"Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.dll","Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Commands.RemoveAzureRmManagedServicesDefinition","Remove-AzManagedServicesDefinition","0","1050","The parameter set '__AllParameterSets' for cmdlet 'Remove-AzManagedServicesDefinition' has been removed.","Add parameter set '__AllParameterSets' back to cmdlet 'Remove-AzManagedServicesDefinition'."