---
title: "Cloud - Azure - Generic Opspack"
description: ""
url: "https://docs.itrsgroup.com/docs/opsview/6.11.7/opspacks/cloud-azure-generic-opspack/index.html"
---
Microsoft Azure is a cloud computing service created for building, testing, deploying and managing applications and services through a global network of Microsoft-managed data centers. It provides software as a service (SAAS), platform as a service and infrastructure as a service and supports many different programming languages, tools and frameworks including both Microsoft-specific and third-party software and systems.

## What You Can Monitor

Opsview Monitor's Azure Generic Opspack provides you with the tools to monitor any supported **Azure Monitor** metric.
Easily integrate your custom defined Azure metrics within a few clicks.

## Service Checks

| Service Check   | Description             |
|:----------------|:------------------------|
| Azure - Generic | Generic Metric details. |

## Setup Azure for Monitoring

This Opspack requires Administrator access on Azure. You need to retrieve the following credentials:

- Subscription ID
- Tenant/Directory ID
- Client/Application ID
- Secret Key

### Find Subscription ID

The Subscription ID can be found in the **Subscriptions** section under the **All services** section from the Azure dashboard

![Find Azure Subscription ID](https://docscdn.itrsgroup.com/opsview/images/opspacks-cloud-azure-generic-find_subscription_id_1.png)

![Find Azure Subscription ID](https://docscdn.itrsgroup.com/opsview/images/opspacks-cloud-azure-generic-find_subscription_id_2.png)

### Find the Tenant/Directory ID

The Tenant/Directory ID can be found in the **Azure Active Directory** under the **Properties** section from the Azure dashboard

![Find Azure Tenant/Directory ID](https://docscdn.itrsgroup.com/opsview/images/opspacks-cloud-azure-generic-find_directory_id.png)

### Find the Client/Application ID for your application

You need to create and register your application if you haven't already. Use the following documentation from Microsoft: [Create an Azure Active Directory application](
https://learn.microsoft.com/en-us/entra/identity-platform/howto-create-service-principal-portal#create-an-azure-active-directory-application)

The Client/Application ID can be found in **Azure Active Directory** under the **App registrations** section from the Azure dashboard

![Find Azure Client/Application ID](https://docscdn.itrsgroup.com/opsview/images/opspacks-cloud-azure-generic-find_application_id.png)

### Generate the Secret Key for your application

You will need to create a Secret Key for your application, once this has been created its value will be hidden so save the value during creation

To create the Secret Key, select your application from the list, select the **Settings** within your application and then select the **Keys** option

There you can create a new key by adding the description and expiration period and the value will be generated

![Create Secret Key](https://docscdn.itrsgroup.com/opsview/images/opspacks-cloud-azure-generic-create_secret_key.png)

### Provide access to the subscription you wish to monitor

Navigate to the **Subscriptions** section and select the Subscription you selected before

In the Subscription to be monitored, click **Access Control (IAM)**

Then click the **Add** button, select **Monitoring Contributor** and select the application

![Add Subscription to Application](https://docscdn.itrsgroup.com/opsview/images/opspacks-cloud-azure-generic-add_subscription_1.png)

![Add Subscription to Application](https://docscdn.itrsgroup.com/opsview/images/opspacks-cloud-azure-generic-add_role.png)

If you are running more than one subscription these steps will need to be done for each one you wish to monitor

## Setup and Configuration

### Add the Host Template

Add the **Cloud - Azure - Generic** Host Template to your Opsview Monitor host.


**Note**


For more information, refer to the documentation on [Adding Host Templates to Hosts](https://docs.itrsgroup.com/docs/opsview/6.11.7/host/index.html#host-templates).



### Add and configure variables required for this host

First, ensure that the **Primary Hostname/IP** field of your host exactly matches the name of the Azure resource you are requesting metrics from.
Since this is not actually a hostname or IP address, we recommend you additionally set your **Host Check Command** to be**Always assumed to be UP** to prevent Opsview considering the Host as DOWN.


**Note**


Refer to [Host Configuration](https://docs.itrsgroup.com/docs/opsview/6.11.7/host/index.html) for more details.



Add the **AZURE_CREDENTIALS** Variable to the host. In the **Value** column, add the name of the Azure Resource Group your resource resides in.
Then override the Subscription ID, Client ID, Secret Key and Tenant ID to match the values retrieved earlier.

Add the **AZURE_SEARCH_VALUES** Variable to the host. To fill in this Variable, you will need to refer to the [Azure Monitor supported metric documentation](https://docs.microsoft.com/en-us/azure/azure-monitor/essentials/metrics-supported) from Microsoft, which details the available options for every supported resource.
For example, the following section of the linked documentation lists the supported metrics for Azure Virtual Machines:

![View Output](https://docscdn.itrsgroup.com/opsview/images/opspacks-cloud-azure-generic-monitor_supported_metrics.png)

In Opsview, in the **Value** column for the **AZURE_SEARCH_VALUES** Variable, add the name of the desired metric you want to monitor - the section labelled in the screenshot above as **Metric Name**.

Then, override the **Provider** field with the appropriate Azure Monitor metric provider for your desired metric.
Note that this is not the same as a **Metric Namespace**.
Each supported metric for your resource should be listed under the correct provider in the Azure Monitor documentation - you can see it labelled above in the screenshot.

Then, override the **Aggregation** field with the correct aggregation string for your desired metric, also taken from the Azure Monitor supported metric documentation. This is also labelled above.

Finally, override the **UOM** field with the unit of measurement you want this metric to use within Opsview, used for display and graphing purposes. This does not have to match the contents of the **Unit** column shown above - for instance, you could use **B** rather than **Bytes**.

_Full Example_:

To set up a custom metric for an Azure Virtual Machine called **myazurevm** within the Resource Group **myresgroup**, my Host should be set up with the following values for **Primary Address/IP**, and the **Cloud - Azure - Generic** Host Template:

![View Output](https://docscdn.itrsgroup.com/opsview/images/opspacks-cloud-azure-generic-host_setup1.png)

with the following **Host Check Command** (in the **Advanced** section):

![View Output](https://docscdn.itrsgroup.com/opsview/images/opspacks-cloud-azure-generic-host_setup2.png)

and the **AZURE_CREDENTIALS** Variable should look like:

![View Output](https://docscdn.itrsgroup.com/opsview/images/opspacks-cloud-azure-generic-credentials_setup.png)

If the desired metric is the **OS Disk IOPS Consumed Percentage**, then the **AZURE_SEARCH_VALUES** Variable should be set up as:

![View Output](https://docscdn.itrsgroup.com/opsview/images/opspacks-cloud-azure-generic-search_values_setup.png)

This will result in the following Service Check output format:

```
METRIC OK - OS Disk IOPS Consumed Percentage is 5% | 'OS Disk IOPS Consumed Percentage'=5%
```

### Apply Changes

Apply Changes and the custom metric will then be monitored:

![View Output](https://docscdn.itrsgroup.com/opsview/images/opspacks-cloud-azure-generic-output.png)

## Plugin help


**Secure Args**


The `check_azure.py` plugin uses the [Secure Args](https://docs.itrsgroup.com/docs/opsview/6.11.7/configuration/secure-arguments/index.html) feature for argument passing.




