Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

New-AzDataCollectionRuleAssociation

create an association.

Syntax

CreateExpanded (Default)

New-AzDataCollectionRuleAssociation
 -AssociationName <String>
 -ResourceUri <String>
 [-DataCollectionEndpointId <String>]
 [-DataCollectionRuleId <String>]
 [-Description <String>]
 [-DefaultProfile <PSObject>]
 [-WhatIf]
 [-Confirm]
 [<CommonParameters>]

CreateViaJsonFilePath

New-AzDataCollectionRuleAssociation
 -AssociationName <String>
 -ResourceUri <String>
 -JsonFilePath <String>
 [-DefaultProfile <PSObject>]
 [-WhatIf]
 [-Confirm]
 [<CommonParameters>]

CreateViaJsonString

New-AzDataCollectionRuleAssociation
 -AssociationName <String>
 -ResourceUri <String>
 -JsonString <String>
 [-DefaultProfile <PSObject>]
 [-WhatIf]
 [-Confirm]
 [<CommonParameters>]

Description

create an association.

Examples

Example 1: Create data collection rule association with specified data collection rule

New-AzDataCollectionRuleAssociation -AssociationName myCollectionRule2-association1 -ResourceUri /subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourcegroups/amcs-test/providers/microsoft.compute/virtualmachines/monitortestvm01 -DataCollectionRuleId /subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/AMCS-TEST/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule2
DataCollectionEndpointId :
DataCollectionRuleId : /subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/AMCS-TEST/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule2
Description :
Etag : "20017ecf-0000-0100-0000-651147350000"
Id : /subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/amcs-test/providers/microsoft.compute/virtualmachines/monitortestvm01/providers/Microsof
 t.Insights/dataCollectionRuleAssociations/myCollectionRule2-association1
MetadataProvisionedBy :
MetadataProvisionedByResourceId :
Name : myCollectionRule2-association1
ProvisioningState :
ResourceGroupName : amcs-test
SystemDataCreatedAt : 9/25/2023 8:39:15 AM
SystemDataCreatedBy : v-jiaji@microsoft.com
SystemDataCreatedByType : User
SystemDataLastModifiedAt : 9/25/2023 8:39:15 AM
SystemDataLastModifiedBy : v-jiaji@microsoft.com
SystemDataLastModifiedByType : User
Type : Microsoft.Insights/dataCollectionRuleAssociations

This command creates data collection rule association with specified data collection rule.

Example 2: Create data collection endpoint association with specified data collection endpoint

New-AzDataCollectionRuleAssociation -AssociationName configurationAccessEndpoint -ResourceUri /subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourcegroups/amcs-test/providers/microsoft.compute/virtualmachines/monitortestvm01 -DataCollectionEndpointId /subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/AMCS-TEST/providers/Microsoft.Insights/dataCollectionEndpoints/myCollectionEndpoint
DataCollectionEndpointId : /subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/AMCS-TEST/providers/Microsoft.Insights/dataCollectionEndpoints/myCollectionEndpoint
DataCollectionRuleId :
Description :
Etag : "21017484-0000-0100-0000-6511505c0000"
Id : /subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/amcs-test/providers/microsoft.compute/virtualmachines/monitortestvm01/providers/Microsof
 t.Insights/dataCollectionRuleAssociations/configurationAccessEndpoint
MetadataProvisionedBy :
MetadataProvisionedByResourceId :
Name : configurationAccessEndpoint
ProvisioningState :
ResourceGroupName : amcs-test
SystemDataCreatedAt : 9/25/2023 9:18:20 AM
SystemDataCreatedBy : v-jiaji@microsoft.com
SystemDataCreatedByType : User
SystemDataLastModifiedAt : 9/25/2023 9:18:20 AM
SystemDataLastModifiedBy : v-jiaji@microsoft.com
SystemDataLastModifiedByType : User
Type : Microsoft.Insights/dataCollectionRuleAssociations

This command creates specific data collection endpoint association with specified data collection endpoint.

Parameters

-AssociationName

The name of the association. The name is case insensitive.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:Name

Parameter sets

-Confirm

Prompts you for confirmation before running the cmdlet.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:cf

Parameter sets

-DataCollectionEndpointId

The resource ID of the data collection endpoint that is to be associated.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-DataCollectionRuleId

The resource ID of the data collection rule that is to be associated.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:RuleId

Parameter sets

-DefaultProfile

The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.

Parameter properties

Type:PSObject
Default value:None
Supports wildcards:False
DontShow:False
Aliases:AzureRMContext, AzureCredential

Parameter sets

-Description

Description of the association.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-JsonFilePath

Path of Json file supplied to the Create operation

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-JsonString

Json string supplied to the Create operation

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-ResourceUri

The identifier of the resource.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:TargetResourceId

Parameter sets

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:wi

Parameter sets

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Outputs

IDataCollectionRuleAssociationProxyOnlyResource


Feedback

Was this page helpful?