Open Klaas- opened 1 month ago
Workaround using azure_rm_deployment (not idempotent):
- name: Create Data Collection Rule Association for new VM
azure.azcollection.azure_rm_deployment:
resource_group: "{{ resource_group_name }}"
name: "{{ inventory_hostname_short }}_data_collection_rule_association"
location: westus
template:
$schema: "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#"
contentVersion: "1.0.0.0"
resources:
- type: Microsoft.Insights/dataCollectionRuleAssociations
apiVersion: 2022-06-01
name: "{{ dcr_name }}-association"
scope: "{{ vm_id }}"
properties:
dataCollectionRuleId: "{{ drc_id }}"
SUMMARY
I am currently looking at automating data collection rules and associations via ansible, it does not seem that this is possible yet
ISSUE TYPE
COMPONENT NAME
data-collection-rules https://learn.microsoft.com/en-us/rest/api/monitor/data-collection-rules/create?view=rest-monitor-2023-03-11&tabs=HTTP data-collection-rule-associations https://learn.microsoft.com/en-us/rest/api/monitor/data-collection-rule-associations/create?view=rest-monitor-2023-03-11&tabs=HTTP
ADDITIONAL INFORMATION