Hello Kenneth Echevarria ,
Greetings! Welcome to Microsoft Q&A Platform.
I understand that you’re encountering an issue with SFTP permissions while trying to delete files in the root folder.
Are you using an Azure File? If so, Azure Files doesn’t support SFTP. Make sure you’re using the appropriate method for file management.
If you’re using Azure App Services, consider other approaches for deployment and file management.
Hidden Folders and Permissions: Sometimes, hidden folders or files (such as .bin folders inside /node modules) can prevent deletion. Ensure that there are no hidden files or directories blocking the operation.
Verify that you have the necessary permissions to delete files. Access denied errors often occur due to insufficient permissions.
App Settings in Azure: Check your Azure App Service settings. Specifically, look for the following App settings:
WEBSITE_RUN_FROM_ZIP
WEBSITE_RUN_FROM_PACKAGE
These settings can affect the read-only status of the wwwroot folder. If they are set to enforce read-only mode, you won’t be able to delete files.
Try changing the value of WEBSITE_RUN_FROM_PACKAGE from 1 to 0. This might allow you to delete the files.
Stop the Web App: Before attempting to delete files, stop the Azure Web App (either through the Azure Portal or CLI). Then, access Kudu (Azure’s deployment engine) and delete the node_modules folder from there. Sometimes, stopping the app first helps unblock file operations.
Rename or Move Files: If you encounter a file in a weird state, try renaming or moving it to a different location. This might unblock the deletion process.
Hope this answer helps! Please let us know if you have any further queries. I’m happy to assist you further.
Please "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.