Skip to Content

Solved: How to fix “You do not have permission to view this directory or page” error with Archive Files Task in Azure DevOps Build Pipeline?

Troubleshooting Question

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.

Solved: How to fix "You do not have permission to view this directory or page" error with Archive Files Task in Azure DevOps Build Pipeline?

Solution

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.

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.

Alex Lim is a certified IT Technical Support Architect with over 15 years of experience in designing, implementing, and troubleshooting complex IT systems and networks. He has worked for leading IT companies, such as Microsoft, IBM, and Cisco, providing technical support and solutions to clients across various industries and sectors. Alex has a bachelor’s degree in computer science from the National University of Singapore and a master’s degree in information security from the Massachusetts Institute of Technology. He is also the author of several best-selling books on IT technical support, such as The IT Technical Support Handbook and Troubleshooting IT Systems and Networks. Alex lives in Bandar, Johore, Malaysia with his wife and two chilrdren. You can reach him at [email protected] or follow him on Website | Twitter | Facebook

    Ads Blocker Image Powered by Code Help Pro

    Your Support Matters...

    We run an independent site that is committed to delivering valuable content, but it comes with its challenges. Many of our readers use ad blockers, causing our advertising revenue to decline. Unlike some websites, we have not implemented paywalls to restrict access. Your support can make a significant difference. If you find this website useful and choose to support us, it would greatly secure our future. We appreciate your help. If you are currently using an ad blocker, please consider disabling it for our site. Thank you for your understanding and support.