I am new to Ansible and I am trying to create Azure diagonistics settings for Azure VNET using ansible module azure_rm_resource. And I am getting this specific error. I am not sure how to fix it. Any suggetsion would help here.
Ansible task:
- name: Create Log diagonistics Setting with storage account
azure_rm_resource:
url: https://management.azure.com/subscriptions/sub_id/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/vnet1/providers/Microsoft.Insights/diagnosticSettings/test?api-version=2021-05-01-preview
method: PUT
client_id: “{{ client_id }}”
secret: “{{ secret_val }}”
tenant: “{{ tenant }}”
subscription_id: “{{ subscription }}”
body:
properties:
storageAccountId: /subscriptions/sub_id/resourceGroups/rg/providers/Microsoft.Storage/storageAccounts/staccount
metrics:
category: AllMetrics
enabled: true
logs:
categoryGroup: allLogs
enabled: true
logAnalyticsDestinationType: null
I have tried this with Log analyics workspace workspaceId still the same issue. changed the api version but it didnt work. Tried with the ansible module azure.azcollection.azure_rm_monitordiagnosticsetting but it was not recognised although I had azure.azcollection installed.
I want to create/update diagonostic settings for azure resources
Susmita Ghosh is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.