Remove-AzSynapseRoleAssignment

Deletes a Synapse Analytics role assignment.

Syntax

Remove-AzSynapseRoleAssignment
      -WorkspaceName <String>
      -RoleDefinitionName <String>
      -SignInName <String>
      [-ItemType <WorkspaceItemType>]
      [-Item <String>]
      [-PassThru]
      [-AsJob]
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Remove-AzSynapseRoleAssignment
      -WorkspaceName <String>
      -RoleAssignmentId <String>
      [-PassThru]
      [-AsJob]
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Remove-AzSynapseRoleAssignment
      -WorkspaceName <String>
      -RoleDefinitionName <String>
      -ObjectId <String>
      [-ItemType <WorkspaceItemType>]
      [-Item <String>]
      [-PassThru]
      [-AsJob]
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Remove-AzSynapseRoleAssignment
      -WorkspaceName <String>
      -RoleDefinitionId <String>
      -ObjectId <String>
      [-ItemType <WorkspaceItemType>]
      [-Item <String>]
      [-PassThru]
      [-AsJob]
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Remove-AzSynapseRoleAssignment
      -WorkspaceName <String>
      -RoleDefinitionName <String>
      -ServicePrincipalName <String>
      [-ItemType <WorkspaceItemType>]
      [-Item <String>]
      [-PassThru]
      [-AsJob]
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Remove-AzSynapseRoleAssignment
      -WorkspaceObject <PSSynapseWorkspace>
      -RoleAssignmentId <String>
      [-PassThru]
      [-AsJob]
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Remove-AzSynapseRoleAssignment
      -WorkspaceObject <PSSynapseWorkspace>
      -RoleDefinitionName <String>
      -SignInName <String>
      [-ItemType <WorkspaceItemType>]
      [-Item <String>]
      [-PassThru]
      [-AsJob]
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Remove-AzSynapseRoleAssignment
      -WorkspaceObject <PSSynapseWorkspace>
      -RoleDefinitionName <String>
      -ObjectId <String>
      [-ItemType <WorkspaceItemType>]
      [-Item <String>]
      [-PassThru]
      [-AsJob]
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Remove-AzSynapseRoleAssignment
      -WorkspaceObject <PSSynapseWorkspace>
      -RoleDefinitionId <String>
      -ObjectId <String>
      [-ItemType <WorkspaceItemType>]
      [-Item <String>]
      [-PassThru]
      [-AsJob]
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Remove-AzSynapseRoleAssignment
      -WorkspaceObject <PSSynapseWorkspace>
      -RoleDefinitionName <String>
      -ServicePrincipalName <String>
      [-ItemType <WorkspaceItemType>]
      [-Item <String>]
      [-PassThru]
      [-AsJob]
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]

Description

The Remove-AzSynapseRoleAssignment cmdlet permanently deletes an Azure Synapse Analytics role assignment.

The cmdlet may call below Microsoft Graph API according to input parameters:

  • GET /users/{id}
  • GET /servicePrincipals/{id}

Note

To removing a role assignment for a service principal, pass the object ID of the principal in the ObjectId parameter.

Examples

Example 1

Remove-AzSynapseRoleAssignment -WorkspaceName ContosoWorkspace -RoleAssignmentId ContosoRoleAssignmentId

This command deletes an Azure Synapse Analytics role assignment with a role assignment Id.

Example 2

Remove-AzSynapseRoleAssignment -WorkspaceName ContosoWorkspace -RoleDefinitionName ContosoRole -SignInName ContosoName

This command deletes an Azure Synapse Analytics role assignment at workspace level with a role name and a user principal name.

Example 3

Remove-AzSynapseRoleAssignment -WorkspaceName ContosoWorkspace -RoleDefinitionName ContosoRole -SignInName ContosoName -ItemType ContosoItemType -Item ContosoItem

This command deletes an Azure Synapse Analytics role assignment with a role name, a user principal name, a item type and a item.

Example 4

$ws = Get-AzSynapseWorkspace -Name ContosoWorkspace
$ws | Remove-AzSynapseRoleAssignment -RoleAssignmentId ContosoRoleAssignmentId

This command deletes an Azure Synapse Analytics role assignment with a role assignment Id through pipeline.

Parameters

-AsJob

Run cmdlet in the background

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Confirm

Prompts you for confirmation before running the cmdlet.

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

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with Azure.

Type:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Item

The item of Azure Synapse workspace.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ItemType

The itemtype of Azure Synapse workspace.

Type:Microsoft.Azure.Commands.Synapse.Models.SynapseConstants+WorkspaceItemType
Accepted values:ApacheSparkPool, IntegrationRuntime, LinkedService, Credential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ObjectId

The Microsoft Entra ObjectId of the User, Group or Service Principal.

Type:String
Aliases:Id, PrincipalId
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-PassThru

This Cmdlet does not return an object by default. If this switch is specified, it returns true if successful.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-RoleAssignmentId

The ID of the role assignment.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-RoleDefinitionId

Id of the Role that is assigned to the principal.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-RoleDefinitionName

Name of the Role that is assigned to the principal.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-ServicePrincipalName

The ServicePrincipalName of the service principal.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-SignInName

The email address or the user principal name of the user.

Type:String
Aliases:Email, UserPrincipalName
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-WorkspaceName

Name of Synapse workspace.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-WorkspaceObject

workspace input object, usually passed through the pipeline.

Type:PSSynapseWorkspace
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

Inputs

PSSynapseWorkspace

Outputs

Boolean