question

SaleemBaig-0527 avatar image
0 Votes"
SaleemBaig-0527 asked estkPavel222080-8279 published

Azure App service not allowing to Edit the files present in wwwroot folder: "Access to the path 'D:\home\site\wwwroot\wwwroot/templates/abc.pdf' is denied"

I am facing one weird issue.
I have created one .net core application that overwrites the pdf file available in root location of application; and this is working fine locally.
but when i publish on Azure App service and run, use to get error
Access to the path 'D:\home\site\wwwroot\wwwroot\templates\abc.pptx' is denied.
=====================
Here is the code, i am using in Azure App Service

var masterFile = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot\\templates\\","MasterTemplate.pptx");
var dummyFile = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot\\templates\\", "abc.pptx");

System.IO.File.Copy(masterFile , dummyFile, true);

=====================
Please suggest if you know any solution around...

azure-webapps-content-deploymentazure-webapps-development
· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @SaleemBaig-0527,

We apologize for the frustration this issue may have caused. how are you deploying your app? are you using Azure DevOps? could you please try using Kudu Console to edit your files.

-Grace

0 Votes 0 ·

Hi Grmacjon,
Thanks for your quick response.

Actually, i'm trying to edit the files at run time through code, not from kudo console.

And regarding deployment: We are deploying App using 'Azure Web App Service' using DevOps for automatic deployment.

Please let me know for any clarifications.

0 Votes 0 ·

Hi Grmacjon,

Any update for me on the post?

0 Votes 0 ·

1 Answer

Grmacjon-MSFT avatar image
2 Votes"
Grmacjon-MSFT answered estkPavel222080-8279 published

Hi @SaleemBaig-0527 ,

Thanks for your patience! Based on this SO thread you can try changing this

App Setting Key

 WEBSITE_RUN_FROM_PACKAGE = 1 to 0

"This setting makes wwwroot as a read-only file system. With Run From Package, this is strictly enforced as the wwwroot folder becomes read-only"

If you are still facing this issue please reach out to us at azcommunity@microsoft.com with the subject "ATTN: Grace" and in the body of the email include your Azure Subscription ID.
-Grace


· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @SaleemBaig-0527 ,

Just checking to see if you have any updates about your issue

-Grace

0 Votes 0 ·

thanks, this fix my problem.

0 Votes 0 ·