Storage monitoring is a powerful service that enables automatic sanitization of supported file types at the point of upload. It can continuously monitor a wide range of cloud storage resources and sanitize files in real time.

Follow these steps to enable OVA integration with [Storage Monitoring](/halo/storage-monitoring-overview).

## Prerequisites

Before you begin, ensure the following requirements are met:

- **Domain Name**: configure a domain name for the Storage Monitoring service with a public IP address. Ensure the [SSL certificates](/halo/tls-ssl-configuration) are properly configured for the selected domain.
- **Azure Tenant ID**: identify the `tenant_id` for the Azure tenant to be used.
- **jq**: install [jq](https://jqlang.github.io/jq/download/) on your machine if not already present:
  ```sh
  sudo dnf install -y jq
  ```
- **Azure CLI**: install the [Azure CLI](https://learn.microsoft.com/en-us/cli/azure/install-azure-cli) and authenticate using:
  ```sh
  az login
  ```
- App Registration Setup: run the provided <a href="/.attachments/create-azure-app-registrations-storage-monitor.sh" download>shell script</a> to create an App registration and an Enterprise application. 
    - **Note:** keep a record of the output values as they’ll be required in later steps.
    >```sh
    >bash create-azure-app-registrations-storage-monitor.sh
    >```

## Installing the storage monitor

The OVA includes the storage monitor Helm chart and container image, pre-installed with 0 replicas. SSH into the VM and complete the following steps to enable it.

### 1. Create Kubernetes secrets

The storage monitoring service requires the **tenant ID**, **client ID**, and **client secret** for the service principal.

**Important:**

- Provide values in plain text, the script will automatically handle Base64 encoding.  
- Re-running the script with an existing key updates the value stored in the Kubernetes secret.  

Execute the script as follows:

```sh
bash add_secrets.sh graphapi-clientid <client-id>
bash add_secrets.sh graphapi-clientsecret <client-secret>
bash add_secrets.sh graphapi-tenantid <tenant-id>
```

### 2. Enable storage monitoring

Run the `enable_storage_monitor.sh` script with your domain name and Azure tenant name. This will start the storage monitor service and enable the SharePointMonitoring and OneDriveMonitoring pages in the Halo portal.

```sh
bash enable_storage_monitor.sh <domain_name> <tenant_name>
```

For example:

```sh
bash enable_storage_monitor.sh sm.example.com Contoso
```

### 3. Post-installation

Once the installation completes successfully, follow the instructions in [Storage Monitoring — Microsoft SharePoint](/halo/storage-monitoring-sharepoint) to configure monitors for Microsoft SharePoint, OneDrive, and Outlook.