How we can add diagnostic setting (All Metrics) on Multiple nic card via PowerShell or any other method

SachinKolekar 0 Reputation points
2023-07-25T08:08:59.13+00:00

How we can add diagnostic setting (All Metrics) on Multiple nic card via PowerShell or any other method in one go .

I tried referring doc and its not working for me.
https://learn.microsoft.com/en-us/azure/azure-monitor/essentials/diagnostic-settings?tabs=powershell

Azure Monitor
Azure Monitor
An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.
3,670 questions
{count} votes

1 answer

Sort by: Most helpful
  1. SwathiDhanwada-MSFT 18,996 Reputation points Moderator
    2023-07-25T17:18:37.5533333+00:00

    @SachinKolekar Welcome to Microsoft Q & A Community Forum. You can enable the diagnostic logs for all the nics using Azure Policy service. For this, you need to create a custom policy definition which checks if the diagnostic logs are enabled or not. If enabled, the policy shows compliant. Ifs not enabled, the diagnostic settings are enabled automatically for new resources and for existing resources you need to create remediation task to deploy the diagnostic settings.

    To create custom definition for enabling diagnostic settings for NIC within Azure policy, you can refer this document. To create remediation task for the custom policy, you can refer this document.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.