Update-AzDataCollectionRule
Updates a data collection rule tags property.
Syntax
Update-AzDataCollectionRule
-ResourceGroupName <String>
-RuleName <String>
[-Tag <Hashtable>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Update-AzDataCollectionRule
-RuleId <String>
[-Tag <Hashtable>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Update-AzDataCollectionRule
-InputObject <PSDataCollectionRuleResource>
[-Tag <Hashtable>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
The Update-AzDataCollectionRule cmdlet updates a data collection rule Tags property.
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: Update data collection rule tags
Update-AzDataCollectionRule -RuleName 'newDcr' `
-ResourceGroupName 'testdcr' `
-Tag @{"tag1"="value1"; "tag2"="value2"}
Description :
DataSources : Microsoft.Azure.Commands.Insights.OutputClasses.PSDataCollectionRuleDataSources
Destinations : Microsoft.Azure.Commands.Insights.OutputClasses.PSDataCollectionRuleDestinations
DataFlows : {Microsoft.Azure.Commands.Insights.OutputClasses.PSDataFlow}
ProvisioningState : Succeeded
Etag : "{etag}"
Id : /subscriptions/{subId}/resourceGroups/testdcr/providers/Microsoft.Insights/dataCollectionRules/newDcr
Name : newDcr
Type : Microsoft.Insights/dataCollectionRules
Location : East US 2 EUAP
Tags : {[tag2, value2], [tag1, value1]}
This command updates the tags property for the given data collection rule.
Example 2: Update data collection rule tags
Update-AzDataCollectionRule -RuleId '/subscriptions/{subId}/resourceGroups/testdcr/providers/Microsoft.Insights/dataCollectionRules/newDcr' `
-Tag @{"tag1"="value1"; "tag2"="value2"}
Description :
DataSources : Microsoft.Azure.Commands.Insights.OutputClasses.PSDataCollectionRuleDataSources
Destinations : Microsoft.Azure.Commands.Insights.OutputClasses.PSDataCollectionRuleDestinations
DataFlows : {Microsoft.Azure.Commands.Insights.OutputClasses.PSDataFlow}
ProvisioningState : Succeeded
Etag : "{etag}"
Id : /subscriptions/{subId}/resourceGroups/testdcr/providers/Microsoft.Insights/dataCollectionRules/newDcr
Name : newDcr
Type : Microsoft.Insights/dataCollectionRules
Location : East US 2 EUAP
Tags : {[tag2, value2], [tag1, value1]}
This command updates the tags property for the given data collection rule.
Example 3: Update data collection rule tags
$dcr = Get-AzDataCollectionRule -ResourceGroupName "testdcr" -Name "newDcr"
$dcr | Update-AzDataCollectionRule -Tag @{"tag1"="value1"; "tag2"="value2"}
Description :
DataSources : Microsoft.Azure.Commands.Insights.OutputClasses.PSDataCollectionRuleDataSources
Destinations : Microsoft.Azure.Commands.Insights.OutputClasses.PSDataCollectionRuleDestinations
DataFlows : {Microsoft.Azure.Commands.Insights.OutputClasses.PSDataFlow}
ProvisioningState : {provState}
Etag : "{etag}"
Id : /subscriptions/{subId}/resourceGroups/testdcr/providers/Microsoft.Insights/dataCollectionRules/newDcr
Name : newDcr
Type : Microsoft.Insights/dataCollectionRules
Location : East US 2 EUAP
Tags : {[tag2, value2], [tag1, value1]}
This command updates the tags property for the given data collection rule.
Parameters
-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: | PSDataCollectionRuleResource |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-ResourceGroupName
The resource group name
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-RuleId
The resource ID of the data collection rule
Type: | String |
Aliases: | ResourceId |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-RuleName
The resource name
Type: | String |
Aliases: | Name |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Tag
The tags property of the data collection rule
Type: | Hashtable |
Position: | Named |
Default value: | None |
Required: | False |
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
Outputs
Related Links
Feedback
Submit and view feedback for