@Cahir McCullagh ,
Welcome to Microsoft Q&A Platform!
Thanks for reaching out. You're on the right track with your host.json
settings. The RetentionCooldownInterval
controls how often the cleanup job can run (daily in your case), and RetentionInDays
(which I assume you've set to 7) controls how long run history is kept. However, the retention policy applies prospectively after you deploy the updated host.json
. This means runs that occurred before the deployment won't be immediately deleted.
The cleanup job will only start considering runs for deletion after the deployment. So, you'll need to wait 7 days from your deployment date for any runs older than 7 days from the deployment time to be deleted. It's also worth noting that the cleanup job might not run exactly at the start of each day.
If you still don't see any cleanup after a week, here are some troubleshooting steps:
- Check Logic App Logs: Look for any errors related to "FlowMaintenanceJob" or "Retention" in Azure Monitor.
- Test with a Shorter Retention: Temporarily set
RetentionInDays
to 1 in staging to quickly verify the job is working. Remember to change it back. - Redeploy: A redeployment can sometimes resolve transient issues.
- Storage Account: While less likely, check your Logic App's storage account for any errors.
Reference:
By default, the app setting named Workflows.RuntimeConfiguration.RetentionInDays is set to keep 90 days of data. The host setting named Runtime.FlowMaintenanceJob.RetentionCooldownInterval is set to check every 7 days for old data to delete. If you leave these default values, you might see data up to 97 days old. For example, suppose Azure Logic Apps checks on Day X and deletes data older than Day X - 90 days, and then waits for 7 days before running again. This behavior results in data that ages up to 97 days before the job runs again. However, if you set the interval to 1 day, but leave the retention days at the default value, the maximum delay to delete old data is 90+1 days.
Hope this helps. Do let us know if you have any further queries.
If this answers your query, do click Accept Answer and Yes for "Was this answer helpful." And if you have any further questions, let us know.