Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
@dennis muturi Azure App Service does support volume binding for containers, but it's a bit different from traditional volume mounts. Here's how you can achieve persistence for your Redis container:
Steps to Mount Volumes in Azure App Service for Containers:
- Enable App Service Storage:
- Go to your App Service in the Azure portal.
- Navigate to Configuration > Path Mappings.
- Enable App Service Storage by setting
WEBSITES_ENABLE_APP_SERVICE_STORAGEtotrue.
- Create a Storage Mount:
- In the Path Mappings section, create a new Azure Storage Mount.
- Define the Mount Path within your container (e.g.,
/data/redis). - Save the configuration.
- Configure Your Container:
- Use Docker Compose to define the volume mount.
- Example Docker Compose file:
version: '3.7' services: redis: image: redis:latest volumes: - ${WEBAPP_STORAGE_HOME}/redis:/data/redis restart: always ```[_{{{CITATION{{{_1{Volume Mounts in Azure App Service for Containers - hals.app](https://hals.app/blog/azure-app-service-container-volume-mounts/)
- Deploy Your Container:
- Deploy your container using the Docker Compose file.
- Ensure the container has access to the mounted volume.
By following these steps, you can persist data in your Redis container using Azure App Service storage. This setup should help improve the performance of your API by caching responses effectively.
See: https://hals.app/blog/azure-app-service-container-volume-mounts/