Azure blob storage purge setup - project-sunbird/sunbird-devops GitHub Wiki

Please read backup and purge process for context

Azure logic apps are used for deleting old files in azure blob storage. If there is no existing logic app in the resource group where you want to delete files, add a new logic app, else clone the existing logic app using steps mentioned below

Adding new purge logic app in a resource group

  • Select the resource group containing azure blob files which needs to be purged. Example: sunbird-db-backups-staging

images/azure-blob-purge/resource-group-selection.png

  • Click on resource group
  • Click on "+ Add"
  • Search "Logic App"

images/azure-blob-purge/add-logic-app.png

  • Select "Logic App" and click "Create"
  • Enter name of logic app. Example: sunbird-postgresql-backup-purge-staging
  • Select appropriate location. Example: Central India
  • Click on "Create" and wait for deployment to succeed

images/azure-blob-purge/enter-logic-app-details.png

  • Go to resource group selected above example: sunbird-db-backups-staging
  • Click on logic app created above example: sunbird-postgresql-backup-purge-staging. This will open logic app design template selection page
  • Scroll down to find "Delete old Azure blobs", click on it and click "use this template"

images/azure-blob-purge/logic-app-designer-template-selection.png

  • This will open page asking you to create connection to blob storage

images/azure-blob-purge/logic-app-connection-create-prompt.png

  • Click on "Create"
  • Enter connection name. Example: sunbird-backup-staging-purge
  • Select the storage account. Example: sunbirdbackupstaging
  • Click on create

images/azure-blob-purge/logic-app-connection-data.png

  • After connection creation is successful, click on continue

images/azure-blob-purge/logic-app-connection-continue.png

  • Select recurrence. You can use the default which is once every day
  • Set expiration age. You can use default which -30 means delete files older than 30 days
  • Specify folder. Example: postgresql-backup

images/azure-blob-purge/logic-app-recurrence-days-blob-selection.png

  • You can leave other values to defaults
  • Click on save

Cloning purge logic app in a resource group

  • Select the resource group containing azure blob files which needs to be purged. Example: sunbird-db-backups-staging
  • Click on existing purge logic app
  • Click on clone and enter new name
  • Click on save
  • Click on the new logic app and click "Edit"
  • In "List blob" stage, change the folder to new folder containing files to be deleted