## About

Cavisson's Azure integration allows you to monitor your entire Azure cloud infrastructure and obtain detailed insights on the availability and performance of Azure services without installing the Cavisson Agent. You can also correlate data from your Azure applications across logs, metrics, user activity and more all within your monitoring session. Collect the metrics for all Azure services: Container services, Web Application firewall policies, Batch Service, Event Hub, IoT Hub, Logic App, Redis Cache, web Server Farm, SQL Database, SQL Elastic Pool, Virtual Machine Scale Set, and many more.

## Pre-Requisites

Before beginning with the configuration of Azure monitors, make sure that you have the following details ready:

- Tenant ID: The Tenant ID may be referred to as the directory ID, the Azure Active Directory (Azure AD) tenant, Microsoft ID, or for certain reports, the tenantguid. You can obtain the Tenant ID via the Azure Overview Page. Details on getting your tenant ID can be found via the following link:
  https://learn.microsoft.com/en-us/azure/healthcare-apis/register-application#application-id-client-id
- Client ID - Client ID is the Application ID which is created when you register the application. You can get the Client ID in the Azure Overview window, where the Tenant ID is also found. Details on getting your client ID can be found via the following link:
  https://learn.microsoft.com/en-us/azure/healthcare-apis/register-application#application-id-client-id
- Client Secret Key - A Secret string that the application uses to prove its identity when requesting a token. Also can be referred to as an application password. You can get the Client Secret Key by following the steps mentioned in the following link:
  https://learn.microsoft.com/en-us/azure/industry/training-services/microsoft-community-training/frequently-asked-questions/generate-new-clientsecret-link-to-key-vault

## Steps to Generate Azure Credentials

### STEP 1 : Create Azure App Registration

1. Go to Azure Portal
2. Search Azure Active Directory
3. Click App registrations
4. Click New registration
5. Enter:
   - Name: e.g., `aks-metrics-reader`
   - Supported account types: Single tenant (default)
   - Redirect URI: Leave empty
6. Click Register

### STEP 2 : Get the App (Client) ID & Tenant ID

After registration:

1. Go to the app you created
2. Copy:
   - Application (client) ID
   - Directory (tenant) ID

Save these for later.

### STEP 3: Create a Client Secret

In the left menu:

1. Go to Certificates & secrets
2. Select New client secret
3. Add a description → e.g., "metrics access"
4. Choose expiry (6-24 months)
5. Click Add
6. Copy the Value immediately so it will not appear again.

### STEP 4: Assign Azure Role: Monitoring Reader

This role allows the SP to access Azure Monitor metrics.

1. Go to Subscriptions
2. Select your subscription
3. Click Access control (IAM)
4. Click Add role assignment
5. In "Role", search for:
6. Click Next
7. Under "Members" → choose your App Registration
8. Click Assign

### STEP 5: Assign Azure Role: Reader

This allows basic resource GET access (AKS, VMs, etc.).
Repeat the role assignment:

1. Add role assignment
2. Role name:
3. Select your Service Principal
4. Assign

### STEP 6: Final Output You Will Have

You now have:

1. Client ID → For authentication
2. Tenant ID → For Azure AD auth
3. Client Secret → Password for the SP
4. Role access
   - Reader
   - Monitoring Reader

## Configuration

1. Enable Azure monitoring by entering the below information:

- Account Name - The account name is the unique name under which azure metrics will be shown in the metric tree during the monitoring session.
- Client ID - As mentioned in the pre-requisites, obtain the Client ID and pass the value in this field.
- Tenant ID - As mentioned in the pre-requisites, obtain the Tenant ID pass the value in this field.
- Client Secret ID - Value of the Client Secret ID that can be obtained after following the steps mentioned under pre-requisites.

Once you have provided the relevant details, go to the Monitor(s) section and select the different Azure components that you want to monitor. After selecting the required components, get back to the configuration page and click on the Add button to start monitoring your Azure application.

#### Advanced Settings:

- Exclude Monitors(Optional) - By default, all the monitors that you have selected from the Monitor(s) section are applied to all the accounts added via configuration. In case you need to exclude monitoring any specific Azure component, click on the Advanced Setting section, and from the Exclude Monitors dropdown list, select the components that you do not want to monitor.

#### Edit/Delete Added Accounts:

- Once you have added the account(s), you can edit the configurations in case you want to change the Client/TenantID or Client Secret ID by clicking on the Edit icon under the Actions column. To delete the configured account, click on the Delete icon.

### Validation

- To validate the successful implementation of Azure monitor is validated after completing the above fields, it automatically comes on the monitoring homepage UI with the number of monitors are successfully running or failed with details.
- Also, validate the azure metrics under the given account name in the metrics tree.

### Troubleshooting

- If the monitoring session does not show the azure metrics, then check if reader permissions are provided to your credentials. You can check how to provide read-access to any subscription via the following link:
  https://learn.microsoft.com/en-us/azure/role-based-access-control/role-assignments-portal