Link Diagnostics extension schema json with ARM
This message when I go to the diagnostic settings of my virtual machine after deploying the azure diagnostics extension using the arm template given here: https://learn.microsoft.com/en-us/azure/virtual-machines/extensions/diagnostics-template?toc=%2Fazure%2Fazure-monitor%2Ftoc.json#wadmetrics-tables-in-storage
The arm template uses XML for the WAD config, and if I click the message from the portal it suggests to the json here: https://learn.microsoft.com/en-us/azure/azure-monitor/agents/diagnostics-extension-schema-windows
my question is, how do I incorporate this publicconfig json into the arm template for installing the azure diagnostics extension?
Hi Yim, Sam , Thanks for posting your query on Microsoft Q&A.
As per the documentation, the configuration for the diagnostics extension can be formatted in either JSON or XML, but any configuration done in the Azure portal will always be stored as JSON. If you use XML with another configuration method and then change your configuration with the Azure portal, the settings will be changed to JSON.
One possible way to incorporate the publicconfig JSON into the ARM template is to use a nested template that references a separate file containing the JSON schema. You can upload both files to a storage account and then use a SAS token to access them from your main template.
Reference doc: https://techcommunity.microsoft.com/t5/integrations-on-azure-blog/api-connection-deployment-via-arm-template-with-credentials-in/ba-p/3279119
Alternatively, you can use inline parameters and variables to define the publicconfig JSON within your main template.
Reference doc: https://learn.microsoft.com/en-us/azure/azure-monitor/essentials/resource-manager-diagnostic-settings
I hope this helps. If you have any questions, please let me know.
Sign in to comment
for me I'm trying to install the azure diagnostics extension on the virtual machine, but the second link you sent doesn't talk about that unfortunately. as I mentioned, it seems setting the diagnostic settings using xml doesn't work since Azure is only going to support JSON. I'm still confused as to how to define and where to put the publicconfig inside this template. so there's the property for the XML config that I boxed in red, not sure where to put the publicconfig element they talk about here https://learn.microsoft.com/en-us/azure/azure-monitor/agents/diagnostics-extension-schema-windows
@KarishmaTiwari-MSFT just commented above