PowerShell and SXA module installation on Sitecore MCS PaaS 2.0
Problem Statement: I was following the article Download options for Azure AppService deployments to install Sitecore PowerShell and SXA modules on Sitecore Managed Cloud Service PaaS 2.0 instead of my local dev instance.
Sitecore Version: Sitecore 10.4 XP
Managed Cloud Service: PaaS 2.0
I have successfully installed both the PowerShell and SXA modules, and they appear correctly in the CM instance.
But after restarting the CM Web App, both modules disappear from the CM instance, their config file is missing from the App_Service folder, and require reinstallation to complete the setup again.
Here, I have used Sitecore CM instance Development Tools -> Installation Wizard to install the modules.
Solution: To investigate this issue further, I have checked the logs generated in Application Insights to confirm the installation.
Additionally checked the traces and verified that the module is installed in the correct path:
However, upon verifying the existence of the folder in Kudu, it seems the modules are not found in the expected path and are missing.
For further investigation, we have raised a Microsoft support ticket with the help of Sitecore and identified that the web app cache was the source of the issue. You can find more about it here: https://learn.microsoft.com/en-us/azure/app-service/overview-local-cache.
After disabling the local cache, we were able to install the package, and it does not disappear after App_Service restart.
The reason the modules were overwritten is that by default, AppServices create a cache of the existing file system and use that to run the WebApp. So, when we were installing the modules, they were being installed on the cache. As per Sitecore and Microsoft responses, disabling the LOCAL_CACHE for the web app while installing the module resolved the problem. MS support confirmed that the "az webapp deploy" command will update the web app file system permanently, and new content will be cached after the web app restart.
Microsoft Response:
After disabling the app service local cache setting, the files were visible and were persistent even after a restart/scale-up.
The “az webapp deploy” command in Azure CLI is used to deploy applications to Azure App Service. Regarding the local cache, Azure App Service has a feature called "Local Cache," which can be used to improve performance by caching the content of your app locally on the virtual machine where your app is running.
When you deploy an application using “az webapp deploy”, the deployment process itself does not automatically interact with or modify the local cache settings of the Azure App Service. However, if your app is configured to use local cache, the new content will be cached when the app is started or restarted after deployment.
For more detailed information, you can refer to the official Azure documentation on deploying web apps and the local cache feature:
- Azure CLI - az webapp deploy: This documentation provides details on how to use the az webapp deploy command.
- Azure App Service Local Cache: This documentation explains how to configure and use the local cache feature in Azure App Service.
Happy Sitecoreing 😊
Comments
Post a Comment