你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Remove-AzDataCollectionRule

Delete a data collection rule.

Syntax

Remove-AzDataCollectionRule
        -ResourceGroupName <string>
         -RuleName <string>
         [-PassThru]
        [-DefaultProfile <IAzureContextContainer>]
        [-WhatIf]
        [-Confirm]  
      [<CommonParameters>]
Remove-AzDataCollectionRule
        -InputObject <PSDataCollectionRuleResource>
        [-PassThru]
        [-DefaultProfile <IAzureContextContainer>]
        [-WhatIf]
        [-Confirm]  
      [<CommonParameters>]
Remove-AzDataCollectionRule
        -RuleId <string>
        [-PassThru]
        [-DefaultProfile <IAzureContextContainer>]
        [-WhatIf]
        [-Confirm]  
      [<CommonParameters>]

Description

The Remove-AzDataCollectionRule cmdlet delete a data collection rule.

Data Collection Rules (DCR) define data coming into Azure Monitor and specify where that data should be sent or stored. Here is the complete DCR overview article.

Examples

Example 1: Delete data collection rule with name and resource group parameters

Remove-AzDataCollectionRule -ResourceGroupName "testgroup" -RuleName "testDcr"

Example 2: Delete data collection rule with name and resource group return bool

Remove-AzDataCollectionRule -ResourceGroupName "testgroup" -RuleName "testDcr" -PassThru

True

Example 3: Delete data collection rule from InputObject

Get-AzDataCollectionRule -ResourceGroupName "testdcr" -RuleName "dcrFromPipe95" | Remove-AzDataCollectionRule

Example 4: Delete data collection rule from resource id

Remove-AzDataCollectionRule -RuleId "/subscriptions/{subId}/resourceGroups/testdcr/providers/Microsoft.Insights/dataCollectionRules/{dcrName}"

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value: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
Accept pipeline input:False
Accept wildcard characters:False

-ResourceGroupName

The resource group name

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

-RuleId

The resource identifier.

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

-RuleName

The resource name.

Type:String
Aliases:Name
Position:Named
Default value:None
Accept pipeline input:True
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:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

String

Outputs

PSDataCollectionRuleResource