Managed AAP on Azure — Data Retention Policy & Best Practices
Background
This document provides data retention guidelines for customers running Red Hat Ansible Automation Platform (AAP) as a managed application on Microsoft Azure. Following these recommendations ensures database health, prevents backup failures, and maintains optimal platform performance.
Important: For long-term data retention exceeding 30 days for compliance or auditing, external log forwarding is the recommended approach as it keeps the AAP database lean while preserving a complete audit trail externally.
Overview
AAP customers must plan for short-term and long-term data storage. AAP's managed PostgreSQL database is optimized for short-term operational data (e.g., job history, activity streams), typically up to 30 days. For long-term compliance or auditing needs, customers should immediately configure external log aggregation post-deployment. This keeps the internal database lean while preserving a complete audit trail externally. Without regular cleanup, data accumulation leads to:
- Backup timeouts and failures
- Degraded UI performance
- Increased storage costs
- Longer restore times
Data Categories & Retention
1. Job History (Cleanup Job Details)
| What it includes | Job stdout, job events, job metadata (start/finish times, status, launched_by), ad hoc command history, project update history, inventory sync history, workflow job records |
| Recommended retention | 30 days |
| Cleanup schedule | Weekly (Sundays) |
Why it matters: Job history is the single largest data contributor to the AAP database. A customer running 500+ jobs/day at 365-day retention can generate 50+ GB of job event data per year. This is the #1 cause of backup failures. Once the database size prevents successful backups, the system will be in an unsupported state.
2. Activity Stream (Cleanup Activity Stream)
| What it includes | Audit trail of all user and system actions — logins, permission changes, resource creation/deletion, configuration changes |
| Recommended retention | 30 days (align with your organization's audit requirements) |
| Cleanup schedule | Weekly (Tuesdays) |
Why it matters: Activity stream data grows proportionally to user activity. High-user environments (50+ active users) should use shorter retention periods. When the resulting database size prevents successful backups, the system will be in an unsupported state.
How to Configure Retention
For long-term compliance and auditing, the recommended approach is to configure External Log Aggregation post-deployment (refer to the Data Export & Compliance section for details).
To configure the short-term operational data retention (Job History and Activity Stream) via the AAP UI, follow these steps:
- Navigate to Administration > Management Jobs
- For each cleanup job, click the Schedule tab
- Edit the schedule to set:
- Days of data to keep: Enter the number of retention days (e.g.,
120) - Frequency: Set the recurrence (Weekly is the recommended minimum; Daily for large environments)
- Days of data to keep: Enter the number of retention days (e.g.,
- Save the schedule — the cleanup job will run automatically at the next scheduled time
- (Optional) To run cleanup immediately, click the Launch button on the Management Jobs page
Preventing Backup Failures
Root Cause
Managed AAP on Azure uses automated PostgreSQL backups. When the database exceeds the backup storage allocation or the backup takes longer than the maintenance window, the backup fails. Once the database size prevents successful backups—typically due to excessive retention of Job History or Activity Stream data—the Red Hat Ansible Automation Platform environment will be considered in an unsupported state.
Warning Signs
- Slow UI response when loading job history or activity stream
- Backup job notifications showing warnings or failures
- Database size alerts from Azure monitoring
- Job event queries timing out in the API
Immediate Remediation
If backups are already failing, follow these steps:
- Reduce Job History retention to 30 days temporarily
- Manually launch the "Cleanup Job Details" system job from Administration > Management Jobs
- Wait for cleanup to complete (may take 30–60 minutes for large datasets)
- Verify the next scheduled backup succeeds
- Gradually increase retention back to your target (e.g., 60–90 days)
Data Export & Compliance
If your organization requires long-term data retention for compliance or auditing purposes, consider these alternatives to extending in-platform retention:
| Approach | Description |
|---|---|
| External log aggregation | Configure AAP to forward job logs to an external SIEM (Splunk, ELK, Azure Monitor) before cleanup removes them |
| Automation Analytics | Enable Red Hat Insights / Automation Analytics to retain aggregated metrics beyond the cleanup window |
| API-based export | Use the /api/controller/v2/jobs/ and /api/controller/v2/activity_stream/ endpoints to programmatically export data before cleanup |