Configuring azure_monitor output plugin in telegraf

Hi,
I have installed telegraf and started service on my local linux machine and i wanted to send data to azure monitoring using “outputs.azure_monitor” output plugin in telegraf configuration file. can someone guide me what fields need to be changes in “outputs.azure_monitor” plugin considering telegraf is not installed on azure VM’s.

[[outputs.azure_monitor]]

Timeout for HTTP writes.

timeout = “20s”

Set the namespace prefix, defaults to “Telegraf/”.

namespace_prefix = “Telegraf/”

Azure Monitor doesn’t have a string value type, so convert string

fields to dimensions (a.k.a. tags) if enabled. Azure Monitor allows

a maximum of 10 dimensions so Telegraf will only send the first 10

alphanumeric dimensions.

strings_as_dimensions = false

Both region and resource_id must be set or be available via the

Instance Metadata service on Azure Virtual Machines.

Azure Region to publish metrics against.

ex: region = “southcentralus”

region = “”

The Azure Resource ID against which metric will be logged, e.g.

ex: resource_id = “/subscriptions/<subscription_id>/resourceGroups/<resource_group>/providers/Microsoft.Compute/virtualMachines/<vm_name>”

resource_id = “”

Optionally, if in Azure US Government, China, or other sovereign

cloud environment, set the appropriate REST endpoint for receiving

metrics. (Note: region may be unused in this context)

endpoint_url = “https://monitoring.core.usgovcloudapi.net

Hello @Jeevan_Kumar,
Have you tried following the documentation here:

?
What parts confused you?

sorry, for late reply @Anaisdg . I have went through the document, and made changes as.
I have added AZURE_TENANT_ID,AZURE_CLIENT_ID,AZURE_CLIENT_SECRET in my environmental variables as per plugins page,

[[outputs.azure_monitor]]

## Timeout for HTTP writes.

# timeout = “20s”

## Set the namespace prefix, defaults to “Telegraf/”.

# namespace_prefix = “Telegraf/”

## Azure Monitor doesn’t have a string value type, so convert string

## fields to dimensions (a.k.a. tags) if enabled. Azure Monitor allows

## a maximum of 10 dimensions so Telegraf will only send the first 10

## alphanumeric dimensions.

strings_as_dimensions = true

## Both region and resource_id must be set or be available via the

## Instance Metadata service on Azure Virtual Machines.

## Azure Region to publish metrics against.

## ex: region = “southcentralus”

region = "EastUS"

## The Azure Resource ID against which metric will be logged, e.g.

## ex: resource_id = “/subscriptions/<subscription_id>/resourceGroups/<resource_group>/providers/Microsoft.Compute/virtualMachines/<vm_name>”

resource_id = “/subscriptions/f75df7a7-1cee-4e32-bae3-0d84450c6325/resourceGroups/TELEGRAF-TEST/providers/Microsoft.Compute”

resource_id = “/subscriptions/d36308a5-3f66-4a88-9e53-ea6d9d6fe88a/resourceGroups/telegraf/providers/Microsoft.Compute/virtualMachines/telegraf”

## Optionally, if in Azure US Government, China or other sovereign

## cloud environment, set appropriate REST endpoint for receiving

## metrics. (Note: region may be unused in this context)

endpoint_url = “https://EastUS.monitoring.azure.com/

and ended up with error

Error writing to outputs.azure_monitor: unable to fetch authentication credentials: azure.BearerAuthorizer#WithAuthorization: Failed to refresh the Token for request to https://EastUS.monitoring.azure.com//subscriptions/d36308a5-3f66-4a88-9e53-ea6d9d6fe88a/resourceGroups/telegraf/providers/Microsoft.Compute/virtualMachines/telegraf/metrics: StatusCode=401 – Original Error: adal: Refresh request failed.