< Back
Remove-AzureRmApiManagementPolicy
Post
NAME Remove-AzureRmApiManagementPolicy
SYNOPSIS
Removes the API Management policy from a specified scope.
SYNTAX
Remove-AzureRmApiManagementPolicy -ApiId <String> -Context <PsApiManagementContext> [-DefaultProfile <IAzureContextContainer>] [-PassThru]
[-Confirm] [-WhatIf] [<CommonParameters>]
Remove-AzureRmApiManagementPolicy -ApiId <String> -Context <PsApiManagementContext> [-DefaultProfile <IAzureContextContainer>] -OperationId
<String> [-PassThru] [-Confirm] [-WhatIf] [<CommonParameters>]
Remove-AzureRmApiManagementPolicy -Context <PsApiManagementContext> [-DefaultProfile <IAzureContextContainer>] [-PassThru] -ProductId <String>
[-Confirm] [-WhatIf] [<CommonParameters>]
DESCRIPTION
The Remove-AzureRmApiManagementPolicy cmdlet removes the API Management policy from specified scope.
PARAMETERS
-ApiId <String>
Specifies the identifier of an existing API. If you specify this parameter, the cmdlet removes the API-scope policy.
Required? true
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-Context <PsApiManagementContext>
Specifies the instance of the PsApiManagementContext object.
Required? true
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-DefaultProfile <IAzureContextContainer>
The credentials, account, tenant, and subscription used for communication with azure.
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-OperationId <String>
Specifies the identifier of an existing operation. If you specify this parameter with the ApiId parameter, this cmdlet removes the
operation-scope policy.
Required? true
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-PassThru [<SwitchParameter>]
Indicates that this cmdlet returns a value of $True, if it succeeds, or a value of $False, otherwise.
Required? false
Position? named
Default value False
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-ProductId <String>
Specifies the identifier of the existing product. If you specify this parameter, the cmdlet removes the product-scope policy.
Required? true
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-Confirm [<SwitchParameter>]
Prompts you for confirmation before running the cmdlet.
Required? false
Position? named
Default value False
Accept pipeline input? False
Accept wildcard characters? false
-WhatIf [<SwitchParameter>]
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Required? false
Position? named
Default value False
Accept pipeline input? False
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
None
This cmdlet does not accept any input.
OUTPUTS
Boolean
NOTES
Example 1: Remove the tenant level policy
PS C:\\>$apimContext = New-AzureRmApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
PS C:\\>Remove-AzureRmApiManagementPolicy -Context $apimContext
This command removes tenant level policy from API Management.
Example 2: Remove the product-scope policy
PS C:\\>$apimContext = New-AzureRmApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
PS C:\\>Remove-AzureRmApiManagementPolicy -Context $apimContext -ProductId "0123456789"
This command removes product-scope policy from API Management.
Example 3: Remove the API-scope policy
PS C:\\>$apimContext = New-AzureRmApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
PS C:\\>Remove-AzureRmApiManagementPolicy -Context $apimContext -ApiId "9876543210"
This command removes API-scope policy from API Management.
Example 4: Remove the operation-scope policy
PS C:\\>$apimContext = New-AzureRmApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
PS C:\\>Remove-AzureRmApiManagementPolicy -Context $apimContext -ApiId "9876543210" -OperationId "777"
This command removes operation-scope policy from API Management.
RELATED LINKS
Online Version: https://docs.microsoft.com/en-us/powers ... mentpolicy
Get-AzureRmApiManagementPolicy
Set-AzureRmApiManagementPolicy
SYNOPSIS
Removes the API Management policy from a specified scope.
SYNTAX
Remove-AzureRmApiManagementPolicy -ApiId <String> -Context <PsApiManagementContext> [-DefaultProfile <IAzureContextContainer>] [-PassThru]
[-Confirm] [-WhatIf] [<CommonParameters>]
Remove-AzureRmApiManagementPolicy -ApiId <String> -Context <PsApiManagementContext> [-DefaultProfile <IAzureContextContainer>] -OperationId
<String> [-PassThru] [-Confirm] [-WhatIf] [<CommonParameters>]
Remove-AzureRmApiManagementPolicy -Context <PsApiManagementContext> [-DefaultProfile <IAzureContextContainer>] [-PassThru] -ProductId <String>
[-Confirm] [-WhatIf] [<CommonParameters>]
DESCRIPTION
The Remove-AzureRmApiManagementPolicy cmdlet removes the API Management policy from specified scope.
PARAMETERS
-ApiId <String>
Specifies the identifier of an existing API. If you specify this parameter, the cmdlet removes the API-scope policy.
Required? true
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-Context <PsApiManagementContext>
Specifies the instance of the PsApiManagementContext object.
Required? true
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-DefaultProfile <IAzureContextContainer>
The credentials, account, tenant, and subscription used for communication with azure.
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-OperationId <String>
Specifies the identifier of an existing operation. If you specify this parameter with the ApiId parameter, this cmdlet removes the
operation-scope policy.
Required? true
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-PassThru [<SwitchParameter>]
Indicates that this cmdlet returns a value of $True, if it succeeds, or a value of $False, otherwise.
Required? false
Position? named
Default value False
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-ProductId <String>
Specifies the identifier of the existing product. If you specify this parameter, the cmdlet removes the product-scope policy.
Required? true
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-Confirm [<SwitchParameter>]
Prompts you for confirmation before running the cmdlet.
Required? false
Position? named
Default value False
Accept pipeline input? False
Accept wildcard characters? false
-WhatIf [<SwitchParameter>]
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Required? false
Position? named
Default value False
Accept pipeline input? False
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
None
This cmdlet does not accept any input.
OUTPUTS
Boolean
NOTES
Example 1: Remove the tenant level policy
PS C:\\>$apimContext = New-AzureRmApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
PS C:\\>Remove-AzureRmApiManagementPolicy -Context $apimContext
This command removes tenant level policy from API Management.
Example 2: Remove the product-scope policy
PS C:\\>$apimContext = New-AzureRmApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
PS C:\\>Remove-AzureRmApiManagementPolicy -Context $apimContext -ProductId "0123456789"
This command removes product-scope policy from API Management.
Example 3: Remove the API-scope policy
PS C:\\>$apimContext = New-AzureRmApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
PS C:\\>Remove-AzureRmApiManagementPolicy -Context $apimContext -ApiId "9876543210"
This command removes API-scope policy from API Management.
Example 4: Remove the operation-scope policy
PS C:\\>$apimContext = New-AzureRmApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
PS C:\\>Remove-AzureRmApiManagementPolicy -Context $apimContext -ApiId "9876543210" -OperationId "777"
This command removes operation-scope policy from API Management.
RELATED LINKS
Online Version: https://docs.microsoft.com/en-us/powers ... mentpolicy
Get-AzureRmApiManagementPolicy
Set-AzureRmApiManagementPolicy