|
396 | 396 |
|
397 | 397 | [Install AMA](#installation-options) on your VM.
|
398 | 398 |
|
399 |
| -1. **Create a DCR via template deployment:** |
| 399 | +1. **Create a DCR:** |
400 | 400 |
|
401 |
| - The following example sets the maximum amount of disk space used by AMA cache to 5000 MB. |
| 401 | + This example sets the maximum amount of disk space used by AMA cache to 5000 MB. |
402 | 402 |
|
403 | 403 | ```json
|
404 | 404 | {
|
@@ -430,24 +430,70 @@ N/A
|
430 | 430 | }
|
431 | 431 | ```
|
432 | 432 |
|
433 |
| - > [!NOTE] |
434 |
| - > Use the Get DataCollectionRule API to get the DCR payload you created with this template. |
435 |
| - |
436 |
| -1. **Associate DCR with your machine:** |
| 433 | +1. **Associate the DCR with your machine:** |
437 | 434 |
|
438 |
| - This can be done with a template or by using the [Create API](/rest/api/monitor/data-collection-rule-associations/create) with the following details: |
439 |
| - |
440 |
| - * **AssociationName:** agentSettings |
441 |
| - * **ResourceUri:** Full ARM ID of the VM |
442 |
| - * **api-version:** 2023-03-11 (Old API version is also fine) |
443 |
| - * **Body:** |
444 |
| - ```json |
445 |
| - { |
446 |
| - "properties": { |
447 |
| - "dataCollectionRuleId": “Full ARM ID for agent setting DCR” |
448 |
| - } |
449 |
| - } |
450 |
| - ``` |
| 435 | + Use these ARM template and parameter files: |
| 436 | +
|
| 437 | + **ARM template file** |
| 438 | + |
| 439 | + ```json |
| 440 | + { |
| 441 | + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", |
| 442 | + "contentVersion": "1.0.0.0", |
| 443 | + "parameters": { |
| 444 | + "vmName": { |
| 445 | + "type": "string", |
| 446 | + "metadata": { |
| 447 | + "description": "The name of the virtual machine." |
| 448 | + } |
| 449 | + }, |
| 450 | + "associationName": { |
| 451 | + "type": "string", |
| 452 | + "metadata": { |
| 453 | + "description": "The name of the association." |
| 454 | + } |
| 455 | + }, |
| 456 | + "dataCollectionRuleId": { |
| 457 | + "type": "string", |
| 458 | + "metadata": { |
| 459 | + "description": "The resource ID of the data collection rule." |
| 460 | + } |
| 461 | + } |
| 462 | + }, |
| 463 | + "resources": [ |
| 464 | + { |
| 465 | + "type": "Microsoft.Insights/dataCollectionRuleAssociations", |
| 466 | + "apiVersion": "2021-09-01-preview", |
| 467 | + "scope": "[format('Microsoft.Compute/virtualMachines/{0}', parameters('vmName'))]", |
| 468 | + "name": "[parameters('associationName')]", |
| 469 | + "properties": { |
| 470 | + "description": "Association of data collection rule. Deleting this association will break the data collection for this virtual machine.", |
| 471 | + "dataCollectionRuleId": "[parameters('dataCollectionRuleId')]" |
| 472 | + } |
| 473 | + } |
| 474 | + ] |
| 475 | + } |
| 476 | + ``` |
| 477 | + |
| 478 | + **Parameter file** |
| 479 | + |
| 480 | + ```json |
| 481 | + { |
| 482 | + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", |
| 483 | + "contentVersion": "1.0.0.0", |
| 484 | + "parameters": { |
| 485 | + "vmName": { |
| 486 | + "value": "my-azure-vm" |
| 487 | + }, |
| 488 | + "associationName": { |
| 489 | + "value": "my-windows-vm-my-dcr" |
| 490 | + }, |
| 491 | + "dataCollectionRuleId": { |
| 492 | + "value": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/my-resource-group/providers/microsoft.insights/datacollectionrules/my-dcr" |
| 493 | + } |
| 494 | + } |
| 495 | + } |
| 496 | + ``` |
451 | 497 |
|
452 | 498 | 1. **Activate the settings:**
|
453 | 499 |
|
|
0 commit comments