共用方式為


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-11

URI Parameters

Name In Required Type Description
associationName
path True

string

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

resourceUri
path True

string

The identifier of the resource.

api-version
query True

string

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

DataCollectionRuleAssociationProxyOnlyResource

Association was successfully updated

201 Created

DataCollectionRuleAssociationProxyOnlyResource

Association was successfully created

Other Status Codes

ErrorResponseCommonV2

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
createdByType

The type of identity that created the resource.

DataCollectionRuleAssociationProxyOnlyResource

Definition of generic ARM proxy resource.

ErrorAdditionalInfo

The resource management error additional info.

ErrorDetail

The error detail.

ErrorResponseCommonV2

Error response

KnownDataCollectionRuleAssociationProvisioningState

The resource provisioning state.

Metadata

Metadata about the resource

SystemData

Metadata pertaining to creation and last modification of the resource.

createdByType

The type of identity that created the resource.

Name Type Description
Application

string

Key

string

ManagedIdentity

string

User

string

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

Metadata about the resource

properties.provisioningState

KnownDataCollectionRuleAssociationProvisioningState

The resource provisioning state.

systemData

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

ErrorAdditionalInfo[]

The error additional info.

code

string

The error code.

details

ErrorDetail[]

The error details.

message

string

The error message.

target

string

The error target.

ErrorResponseCommonV2

Error response

Name Type Description
error

ErrorDetail

The error object.

KnownDataCollectionRuleAssociationProvisioningState

The resource provisioning state.

Name Type Description
Canceled

string

Creating

string

Deleting

string

Failed

string

Succeeded

string

Updating

string

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

The timestamp of resource creation (UTC).

createdBy

string

The identity that created the resource.

createdByType

createdByType

The type of identity that created the resource.

lastModifiedAt

string

The timestamp of resource last modification (UTC)

lastModifiedBy

string

The identity that last modified the resource.

lastModifiedByType

createdByType

The type of identity that last modified the resource.