Remove-AzDataCollectionRuleAssociation
Delete a data collection rule association.
Syntax
Remove-AzDataCollectionRuleAssociation
-TargetResourceId <String>
-AssociationName <String>
[-PassThru]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Remove-AzDataCollectionRuleAssociation
-InputObject <PSDataCollectionRuleAssociationProxyOnlyResource>
[-PassThru]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Remove-AzDataCollectionRuleAssociation
-AssociationId <String>
[-PassThru]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
The Remove-AzDataCollectionRuleAssociation cmdlet delete a data collection rule association (DCRA).
To apply a DCR to a virtual machine, you create an association for the virtual machine. A virtual machine may have an association to multiple DCRs, and a DCR may have multiple virtual machines associated to it. This allows you to define a set of DCRs, each matching a particular requirement, and apply them to only the virtual machines where they apply. Here is the "Configure data collection for the Azure Monitor agent" using DCRA article.
Examples
Example 1: Delete data collection rule association with name and target resource ID (associated virtual machine) parameters
Remove-AzDataCollectionRuleAssociation -TargetResourceId $vm.Id -AssociationName $assocName
Delete data collection rule association with name and target resource ID (associated virtual machine) parameters
Example 2: Delete data collection rule with Input Object
$dcrAssoc | Remove-AzDataCollectionRule
Delete data collection rule with Input Object
Example 3: Delete data collection rule with the association resource ID property
Remove-AzDataCollectionRuleAssociation -AssociationId $dcrAssoc.Id
Delete data collection rule with the association resource ID property
Parameters
-AssociationId
The resource identifier.
Type: | String |
Aliases: | ResourceId |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-AssociationName
The name of the association resource.
Type: | String |
Aliases: | Name |
Position: | Named |
Default value: | None |
Required: | True |
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: | False |
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 |
-InputObject
PSDataCollectionRuleResource Object
Type: | PSDataCollectionRuleAssociationProxyOnlyResource |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-PassThru
Return true upon successful removal.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-TargetResourceId
The associated resource ID.
Type: | String |
Aliases: | ResourceUri |
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: | False |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Inputs
PSDataCollectionRuleAssociationProxyOnlyResource
Outputs
Related Links
Feedback
Submit and view feedback for