Data Collection Rule Associations - Create
Creates or updates an association.
PUT https://management.azure.com/{resourceUri}/providers/Microsoft.Insights/dataCollectionRuleAssociations/{associationName}?api-version=2023-03-11URI Parameters
| Name | In | Required | Type | Description | 
|---|---|---|---|---|
| association | path | True | string | The name of the association. The name is case insensitive. | 
| resource | path | True | stringminLength: 1 | The identifier of the resource. | 
| api-version | query | True | stringminLength: 1 | The API version to use for this operation. | 
Request Body
| Name | Type | Description | 
|---|---|---|
| properties.dataCollectionEndpointId | string | The resource ID of the data collection endpoint that is to be associated. | 
| properties.dataCollectionRuleId | string | The resource ID of the data collection rule that is to be associated. | 
| properties.description | string | Description of the association. | 
Responses
| Name | Type | Description | 
|---|---|---|
| 200 OK | Association was successfully updated | |
| 201 Created | Association was successfully created | |
| Other Status Codes | Error | 
Security
azure_auth
Azure Active Directory OAuth2 Flow
					Type: 
					oauth2
					Flow: 
					implicit
					Authorization URL: 
					https://login.microsoftonline.com/common/oauth2/authorize
			
Scopes
| Name | Description | 
|---|---|
| user_impersonation | impersonate your user account | 
Examples
| Create or update association | 
| Create or update association with a data collection endpoint | 
Create or update association
Sample request
PUT https://management.azure.com/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVm/providers/Microsoft.Insights/dataCollectionRuleAssociations/myAssociation?api-version=2023-03-11
{
  "properties": {
    "dataCollectionRuleId": "/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule"
  }
}
Sample response
{
  "id": "/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVm/providers/Microsoft.Insights/dataCollectionRuleAssociations/myAssociation",
  "name": "myAssociation",
  "type": "Microsoft.Insights/dataCollectionRuleAssociations",
  "properties": {
    "dataCollectionRuleId": "/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule"
  },
  "systemData": {
    "createdBy": "user1",
    "createdByType": "User",
    "createdAt": "2024-03-22T19:15:08.2155156Z",
    "lastModifiedBy": "user1",
    "lastModifiedByType": "User",
    "lastModifiedAt": "2024-03-22T19:15:08.2155156Z"
  },
  "etag": "00000836-0000-0100-0000-65fdd8bc0000"
}{
  "id": "/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVm/providers/Microsoft.Insights/dataCollectionRuleAssociations/myAssociation",
  "name": "myAssociation",
  "type": "Microsoft.Insights/dataCollectionRuleAssociations",
  "properties": {
    "dataCollectionRuleId": "/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule"
  },
  "systemData": {
    "createdBy": "user1",
    "createdByType": "User",
    "createdAt": "2024-03-22T19:15:08.2155156Z",
    "lastModifiedBy": "user1",
    "lastModifiedByType": "User",
    "lastModifiedAt": "2024-03-22T19:15:08.2155156Z"
  },
  "etag": "00000836-0000-0100-0000-65fdd8bc0000"
}Create or update association with a data collection endpoint
Sample request
PUT https://management.azure.com/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVm/providers/Microsoft.Insights/dataCollectionRuleAssociations/configurationAccessEndpoint?api-version=2023-03-11
{
  "properties": {
    "dataCollectionEndpointId": "/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Insights/dataCollectionEndpoints/myCollectionEndpoint"
  }
}
Sample response
{
  "id": "/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVm/providers/Microsoft.Insights/dataCollectionRuleAssociations/configurationAccessEndpoint",
  "name": "configurationAccessEndpoint",
  "type": "Microsoft.Insights/dataCollectionRuleAssociations",
  "properties": {
    "dataCollectionEndpointId": "/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Insights/dataCollectionEndpoints/myCollectionEndpoint"
  },
  "systemData": {
    "createdBy": "user1",
    "createdByType": "User",
    "createdAt": "2024-03-22T19:15:08.2155156Z",
    "lastModifiedBy": "user1",
    "lastModifiedByType": "User",
    "lastModifiedAt": "2024-03-22T19:15:08.2155156Z"
  },
  "etag": "00000836-0000-0100-0000-65fdd8bc0000"
}{
  "id": "/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVm/providers/Microsoft.Insights/dataCollectionRuleAssociations/configurationAccessEndpoint",
  "name": "configurationAccessEndpoint",
  "type": "Microsoft.Insights/dataCollectionRuleAssociations",
  "properties": {
    "dataCollectionEndpointId": "/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Insights/dataCollectionEndpoints/myCollectionEndpoint"
  },
  "systemData": {
    "createdBy": "user1",
    "createdByType": "User",
    "createdAt": "2024-03-22T19:15:08.2155156Z",
    "lastModifiedBy": "user1",
    "lastModifiedByType": "User",
    "lastModifiedAt": "2024-03-22T19:15:08.2155156Z"
  },
  "etag": "00000836-0000-0100-0000-65fdd8bc0000"
}Definitions
| Name | Description | 
|---|---|
| created | The type of identity that created the resource. | 
| Data | Definition of generic ARM proxy resource. | 
| Error | The resource management error additional info. | 
| Error | The error detail. | 
| Error | Error response | 
| Known | The resource provisioning state. | 
| Metadata | Metadata about the resource | 
| System | Metadata pertaining to creation and last modification of the resource. | 
createdByType 
			
			The type of identity that created the resource.
| Value | Description | 
|---|---|
| User | |
| Application | |
| ManagedIdentity | |
| Key | 
DataCollectionRuleAssociationProxyOnlyResource      
			
			Definition of generic ARM proxy resource.
| Name | Type | Description | 
|---|---|---|
| etag | string | Resource entity tag (ETag). | 
| id | string | Fully qualified ID of the resource. | 
| name | string | The name of the resource. | 
| properties.dataCollectionEndpointId | string | The resource ID of the data collection endpoint that is to be associated. | 
| properties.dataCollectionRuleId | string | The resource ID of the data collection rule that is to be associated. | 
| properties.description | string | Description of the association. | 
| properties.metadata | Metadata about the resource | |
| properties.provisioningState | The resource provisioning state. | |
| systemData | Metadata pertaining to creation and last modification of the resource. | |
| type | string | The type of the resource. | 
ErrorAdditionalInfo  
			
			The resource management error additional info.
| Name | Type | Description | 
|---|---|---|
| info | object | The additional info. | 
| type | string | The additional info type. | 
ErrorDetail 
			
			The error detail.
| Name | Type | Description | 
|---|---|---|
| additionalInfo | The error additional info. | |
| code | string | The error code. | 
| details | The error details. | |
| message | string | The error message. | 
| target | string | The error target. | 
ErrorResponseCommonV2  
			
			Error response
| Name | Type | Description | 
|---|---|---|
| error | The error object. | 
KnownDataCollectionRuleAssociationProvisioningState      
			
			The resource provisioning state.
| Value | Description | 
|---|---|
| Creating | |
| Updating | |
| Deleting | |
| Succeeded | |
| Canceled | |
| Failed | 
Metadata
Metadata about the resource
| Name | Type | Description | 
|---|---|---|
| provisionedBy | string | Azure offering managing this resource on-behalf-of customer. | 
| provisionedByImmutableId | string | Immutable Id of azure offering managing this resource on-behalf-of customer. | 
| provisionedByResourceId | string | Resource Id of azure offering managing this resource on-behalf-of customer. | 
SystemData 
			
			Metadata pertaining to creation and last modification of the resource.
| Name | Type | Description | 
|---|---|---|
| createdAt | string (date-time) | The timestamp of resource creation (UTC). | 
| createdBy | string | The identity that created the resource. | 
| createdByType | The type of identity that created the resource. | |
| lastModifiedAt | string (date-time) | The timestamp of resource last modification (UTC) | 
| lastModifiedBy | string | The identity that last modified the resource. | 
| lastModifiedByType | The type of identity that last modified the resource. |