Persist data inside Azure container app that runs Postgres DB
Asked Answered
B

1

6

I am new to Azure Container Apps. I had a requirement to deploy set of applications to Azure container apps. There was a problem with the setup when I deploy my Postgres DB as container when the container shut down data in the container will destroyed.

I want to persist data, As per the previously asked Question It is unable to persist the data inside the container app for Postgres.

I want to run the containerized the database and persist the volume. How can I do it with the available Azure services.

I am successfully able to run the application in containers but when the container is restart the data inside the container is destroyed.

Battaglia answered 27/12, 2022 at 9:50 Comment(1)
Thank you for the question! Have you found good solution?Sheilasheilah
P
1

Containers are stateless by definition. To persist the database data, you have a couple of options:

1-Create a storage mount to Azure Files, map a folder to the volume and store the database files in that folder. This will store the database files in Azure Storage, outside of the container.

https://www.youtube.com/watch?v=OJkvpWYr57Y

https://learn.microsoft.com/en-us/azure/app-service/configure-connect-to-azure-storage?tabs=portal&pivots=container-linux

2-Instead of using PostgreSQL inside a container, use the Azure Database for PostgreSQL managed service.

https://azure.microsoft.com/en-us/products/postgresql/#overview

Poliard answered 27/12, 2022 at 13:5 Comment(1)
Both links are identical by the way. Please could you update this?Sunshine

© 2022 - 2024 — McMap. All rights reserved.