Remove-​Azure​Rm​Role​Definition

Deletes a custom role in Azure RBAC. The role to be deleted is specified using the Id property of the role. Delete will fail if there are existing role assignments made to the custom role.

Syntax

Remove-AzureRmRoleDefinition
      [-Force]
      -Id <Guid>
      [-PassThru]
      [-Scope <String>]
      [-Confirm]
      [-WhatIf]
      [<CommonParameters>]
Remove-AzureRmRoleDefinition
      [-Name] <String>
      [-Force]
      [-PassThru]
      [-Scope <String>]
      [-Confirm]
      [-WhatIf]
      [<CommonParameters>]

Description

The Remove-AzureRmRoleDefinition cmdlet deletes a custom role in Azure Role-Based Access Control. Provide the Id parameter of an existing custom role to delete that custom role. By default, Remove-AzureRmRoleDefinition prompts you for confirmation. To suppress the prompt, use the Force parameter. If there are existing role assignments made to the custom role to be deleted, the delete will fail.

Examples

-------------------------- Example 1 --------------------------

Get-AzureRmRoleDefinition -Name "Virtual Machine Operator" | Remove-AzureRmRoleDefinition

-------------------------- Example 2 --------------------------

Remove-AzureRmRoleDefinition -Id "52a6cc13-ff92-47a8-a39b-2a8205c3087e"

Required Parameters

-Id

Id of the Role definition to be deleted

Type:Guid
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-Name

Name of the Role definition to be deleted.

Type:String
Position:0
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False

Optional Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Force

If set, does not prompt for a confirmation before deleting the custom role

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-PassThru
Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Scope

Role definition scope.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-WhatIf
Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Notes

Keywords: azure, azurerm, arm, resource, management, manager, resource, group, template, deployment