Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Data Collecion Rules / Data Collection Rule Associations #1656

Open
Klaas- opened this issue Jul 30, 2024 · 1 comment
Open

Support for Data Collecion Rules / Data Collection Rule Associations #1656

Klaas- opened this issue Jul 30, 2024 · 1 comment
Labels
medium_priority Medium priority new_module_issue Request to add a new module work in In trying to solve, or in working with contributors

Comments

@Klaas-
Copy link
Contributor

Klaas- commented Jul 30, 2024

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
  • Feature Idea
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
azure.azcollection.data_collection_rule_associations:
  [auth settings common to all modules]
  association_name:  "The name of the association. The name is case insensitive." # this seems to always be name of rule concatenated with "-association" 
  scope: subscriptions/NNNN/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVm # ie your VM id for example
  data_collection_endpoint_id: "The resource ID of the data collection endpoint that is to be associated"
  data_collection_rule_id:  "The resource ID of the data collection rule that is to be associated."
  #description: "Description of the association." # I have not figured out where this comes out again, it does not seem to be in the get response :) 

same for the rule creation see request body here: https://learn.microsoft.com/en-us/rest/api/monitor/data-collection-rules/create?view=rest-monitor-2023-03-11&tabs=HTTP#request-body
@Klaas-
Copy link
Contributor Author

Klaas- commented Aug 5, 2024

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 }}"

@Fred-sun Fred-sun added new_module_issue Request to add a new module medium_priority Medium priority work in In trying to solve, or in working with contributors labels Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
medium_priority Medium priority new_module_issue Request to add a new module work in In trying to solve, or in working with contributors
Projects
None yet
Development

No branches or pull requests

2 participants