Folder permissions in Azure web sites

2020-03-19 04:19发布

问题:

Just getting my head around the new Azure web sites feature and hitting my first obstacle. I'm deploying a PHP site which writes cache data to the file system, but the app is throwing an error because the folder it wants to write to does not have write permission. Is it possible to set permissions on folders or is this a no-no?

I can probably work round this but would like to know if it's possible.

回答1:

Folder permissions cannot be set/customized. This means whatever location your app writes to should be under your site root.



回答2:

Your site can only write to locations under C:\DWASFiles\Sites\[siteName]\VirtualDirectory0 and to the %TEMP% folder.

Two caveats here:

  1. Stuff can't be written directly under VirtualDirectory0, you have to create a subfolder under there and place your files in that subfolder
  2. The %TEMP% folder really is temporary! If your site instance goes down for any reason and is brought back up somewhere else then everything in your %TEMP% folder will be gone. Use it only for files that really are temporary.


回答3:

Is the folder that the app is trying to write to under the site's folder?

It's my understanding that folder permissions cannot be set/changed. But I haven't seen anything from Microsoft that definitively says "yes" or "no" to that.



回答4:

It should be possible using webdeploy.

However I don't think there is a way do it without manually setting up the webdeploy package - as described in the post http://blogs.msdn.com/b/azureappgallery/archive/2013/04/03/set-file-folder-permissions-for-your-content-on-azure-website-using-web-deployable-package.aspx.