# Azure Monitor

### Description

The Azure Monitor Metrics action allows users to fetch and visualize metrics from Azure Monitor for a specified resource.

### Display Criteria

By default, this Action is disabled and when enabled will appear for all the `azurerm` resources. If you want to display this action only for certain resources, please check [display criteria](#display-criteria).

### Setup

This action requires the following variables as [Workspace Variables](https://docs.terrakube.io/user-guide/variables#workspace-specific-variables) or [Global Variables](https://docs.terrakube.io/user-guide/organizations/global-variables) in the Workspace Organization:

* `ARM_CLIENT_ID`: The Azure Client ID used for authentication.
* `ARM_CLIENT_SECRET`: The Azure Client Secret used for authentication.
* `ARM_TENANT_ID`: The Azure Tenant ID associated with your subscription.
* `ARM_SUBSCRIPTION_ID`: The Azure Subscription ID where the VM is located.

{% hint style="info" %}
The Client ID should have at least **Monitoring Reader** or **Reader** access on resource group or subscription.
{% endhint %}

### Usage

* Navigate to the `Workspace Overview` or the `Visual State` and click on a resource name.

<figure><img src="https://4014930676-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MfAN3V983Y82_trlbcu%2Fuploads%2Fgit-blob-49f6e6461608af5dd24670981261715280988e97%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://4014930676-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MfAN3V983Y82_trlbcu%2Fuploads%2Fgit-blob-a2b272541fbfb839191ddeea47bf1b8868ff3541%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

* Click the **Monitor** tab to view metrics for the selected resource.

<figure><img src="https://4014930676-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MfAN3V983Y82_trlbcu%2Fuploads%2Fgit-blob-a0e0385c63573fd244231ed00a9edee45c3c2d3f%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

* You can view additional details for the metrics using the tooltip.

<figure><img src="https://4014930676-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MfAN3V983Y82_trlbcu%2Fuploads%2Fgit-blob-5fe80fe735b65b67ffb4e642c96500703d86ba28%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

* You can see more details for each chart by navigating through it.

<figure><img src="https://4014930676-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MfAN3V983Y82_trlbcu%2Fuploads%2Fgit-blob-16ac0f06d5a121d31ca0566ee6836d1a4a37798c%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.terrakube.io/user-guide/workspaces/actions/built-in-actions/terrakube.azure-monitor.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
