Azure App Service Deployment slot swapping failing

Vijayakumar Ganji 121 Reputation points
2025-04-19T22:01:19.96+00:00

Below is our set up:


  1. Azure App Service Web App (PHP 8.3 on Linux OS)
  2. Deployment slot (named as pre-deployment)
  3. Mount Points configured and added in Path mappings of Azure Web app configuration as new mount points. (This is done by storage account & private end point for communication. NOTE: Connectivity is good between mount points and app service, checked by nslookup & tcpping and get proper responses).
  4. Mount point locations are /home/site/wwwroot/myvar , /home/site/wwwroot/mydata
  5. VNET Integration is set up for app to communicate with storage account. NOTE: This is done both for deployment slot & production slot. Even the mount points are configured for deployment slots and the connectivity is good.
  6. Start-up command we are using in configuration of Azure web app is: bash /home/site/wwwroot/azure/startup.sh

After all this set up, we are deploying via Azure DevOps and the swapping is failing from pre-deployment slot to production with below error, any guidance please, as we are stuck with thoughts on what is mistake here:

2025-04-14T15:59:02.362Z ERROR - Container start failed for abc_df67bafe with System.AggregateException, One or more errors occurred. (Docker API responded with status code=InternalServerError, response={"message":"failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error mounting "/var/LWASFiles/Sites/abct__c5fe/1-xcea848e" to rootfs at "/home/site/wwwroot/myvar": mkdir /mnt/docker/871072.239872/overlay2/bcddbe6b7bd6d2/merged/home/site/wwwroot/myvar: read-only file system: unknown"})InnerException: Docker.DotNet.DockerApiException, Docker API responded with status code=InternalServerError, response={"message":"failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error mounting "/var/LWASFiles/Sites/abcxz__c5fe/bgt54858e8e" to rootfs at "/home/site/wwwroot/myvar": mkdir /mnt/docker/871072.239872/overlay2/vc3456666864fd6d2/merged/home/site/wwwroot/myvar: read-only file system: unknown"}

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,776 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Shree Hima Bindu Maganti 4,155 Reputation points Microsoft External Staff Moderator
    2025-04-25T08:09:27.0766667+00:00

    Hi @Vijayakumar Ganji
    Apology for the delay response .
    The error you're encountering during the swap operation from the pre-deployment slot to production seems to be related to the mounting of the specified directories. The error message indicates that the system is trying to create a directory in a read-only file system, which suggests that there might be an issue with the mount points or the permissions associated with them- Ensure that the mount points (/home/site/wwwroot/myvar and /home/site/wwwroot/mydata) have the correct permissions set for the Azure App Service to access them.

    •  Since you mentioned that the connectivity is good, double-check the configuration of the storage account and the private endpoint to ensure there are no restrictions that might lead to a read-only state.
    •  Ensure that the VNET integration is correctly configured and that there are no network security group (NSG) rules or firewall settings that might be preventing access to the storage account.
    •  The startup command (bash /home/site/wwwroot/azure/startup.sh) should be verified to ensure that it does not inadvertently change the state of the file system or affect the mount points.
    •  Consider using the swap with preview feature to validate the settings and ensure that the application runs correctly with the new configuration before completing the swap.
      Troubleshoot swaps Understand what happens during a swap
      let me know if you have any further assistances.
      If the above answer helped, please do not forget to "Accept Answer" as this may help other community members to refer the info if facing a similar issue.
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.