TorbenPH
TorbenPH

Reputation: 1

Logic App diagnostic setting not being exported

Until now I was under the impression that whatever I configure for an item in the azure portal, I will be able to export that item, persisting all conffiguration settings in the exported ARM template for automation purposes.

Now I am confused...

I have a logic app that was configured with a diagnostic setting, allowing me to have the logic app logs and metrics stored/send to a Log Analytics workspace. But when I choose to export the logic app, the diagnostic setting is not included in the exported ARM template? I would have expected to find something similar to this: https://learn.microsoft.com/en-us/azure/azure-monitor/essentials/resource-manager-diagnostic-settings#diagnostic-setting-for-log-analytics-workspace

Also when reviewing the logic app from the ressource explorer (ressources.azure.com) the diagnostic setting is not visible.

It makes me extremely unconfortable that some configaurations seems to be stored elsewhere.

Does anybody know where the diagnostic settings are getting stored? Why are they not in the ARM template? What should I do in order to have the Diagnostic setting exported properly? I know that I can just add it to the ARM template myself, but that's not the issue here. I need to be able to rely on a process, that exports all configurations settings at any time.

Any feedback will be very much appreciated.

Upvotes: 0

Views: 687

Answers (1)

Delliganesh Sevanesan
Delliganesh Sevanesan

Reputation: 4776

The diagnostic setting cannot appear in the resources template which we are enabled the diagnostic for a resource.

Check here for export metrics for particular resource

Note : Diagnostic settings for Activity logs are created for a subscription, not for a resource group like settings for Azure resources. To deploy the Resource management template, use New-AzSubscriptionDeployment for PowerShell or az deployment sub create for Azure CLI.

Enable Logic Apps Diagnostics within ARM Template

The “resources” array should be within the “Microsoft.Logic/workflows” resource in the template, same level as “type”, “name” etc.

Refer how to enable logic app diagnostics in arm template: Enable Logic Apps Diagnostics within ARM Template & LogicApps_DeployDiagnosticLog_

We have an another solution to enable the diagnostic setting for resources using azure policy check here

Upvotes: 0

Related Questions