Remove-AzDataCollectionRuleAssociation
Delete a data collection rule association.
Note
This is the previous version of our documentation. Please consult the most recent version for up-to-date information.
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
PS C:\>Remove-AzDataCollectionRuleAssociation -TargetResourceId $vm.Id -AssociationName $assocName
Example 2: Delete data collection rule with Input Object
PS C:\>$dcrAssoc | Remove-AzDataCollectionRule
Example 3: Delete data collection rule with the association resource ID property
PS C:\>Remove-AzDataCollectionRule -AssociationId $dcrAssoc.Id
Parameters
The resource identifier.
| Type: | String |
| Aliases: | ResourceId |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The name of the association resource.
| Type: | String |
| Aliases: | Name |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
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 |
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 |
PSDataCollectionRuleResource Object
| Type: | PSDataCollectionRuleAssociationProxyOnlyResource |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
The associated resource ID.
| Type: | String |
| Aliases: | ResourceUri |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
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
PSDataCollectionRuleAssociationProxyOnlyResource