I’m encountering an issue when using the “Archive Files” task within an Azure DevOps build pipeline. After releasing the build, my Azure website displays the error message: “You do not have permission to view this directory or page.”
Interestingly, when I use the “Copy Files” task as a workaround, the website functions correctly. However, the “Copy Files” task takes significantly longer compared to the “Archive Files” task.
I’m seeking assistance in resolving this error to ensure that the “Archive Files” task can be used without any permission-related issues on my Azure website. Any guidance or help in addressing this problem would be greatly appreciated.
To address the issue and resolve the “You do not have permission to view this directory or page” error when using the “Archive Files” task in Azure DevOps build pipelines, you can follow these steps:
Step 1: Navigate to the task settings for the “Archive Files” task in your Azure DevOps build pipeline.
Step 2: Locate the option labeled “Prepend root folder name to archive path” and ensure that it is unchecked.
By unchecking this option, you prevent the task from zipping up everything within a “build” folder and deploying it in that manner. This was causing the website to see only the “build” directory in the “wwwroot,” triggering the error message.
Once you uncheck this option, the task will correctly zip the files and deploy them to the “wwwroot” directory as intended. This adjustment should resolve the error, and your website should function as expected, with the correct access to the index.html file in the “wwwroot” directory.