Attempting to enable persistent storage. However, it keeps deleting what's in my container's folder with "hostingstart.html"
Very simple test using apache httpd (following tutorial guidance here):
version: '3.3'
services:
apache:
image: httpd:latest
# volumes:
# - ${WEBAPP_STORAGE_HOME}/site/wwwroot:/usr/local/apache2/htdocs
ports:
- "8000:80"
restart: always
- Create Resource Group:
az group create --name PandaRG --location "East US" - Create App Service Plan:
az appservice plan create --name PandaBearAppPlan --resource-group PandaRG --sku B1 --is-linux - Create webapp:
az webapp config container set --resource-group PandaRG --name pandabear --multicontainer-config-type compose --multicontainer-config-file docker-compose-apache.yml - Navigate to webapp and see default apache page "It works"
- Enable persistent storage:
az webapp config appsettings set --resource-group PandaRG --name pandabear --settings WEBSITES_ENABLE_APP_SERVICE_STORAGE=TRUE - Uncomment
volumesandWEBAPP_STORAGE_HOMElines in docker-compose file. - Update app with new config:
az webapp config container set --resource-group PandaRG --name pandabear --multicontainer-config-type compose --multicontainer-config-file docker-compose-apache.yml - Navigate back to webapp and see default apache page is gone. Now I see "hostingstart.html" listed
How can I prevent my files from being overwritten when I setup persistent storage?
This behavior is often observed when Azure App Service initializes and detects an empty directory, so it places the default "hostingstart.html" file there.
Webapp with a container configuration:
Enable persistent storage:
Redeploy the Docker container with the updated
test.htmlfile to Azure App Service.No change in app settings.