Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I write to file system on azure web site?

Can I write to file system on azure Web Site? for example updating or installing plugins/themes in Wordpress from dashboard. AFAIK, it is not possible on Heroku so what about Azure Web Sites?

like image 881
Ansd Avatar asked Oct 18 '12 21:10

Ansd


People also ask

Which of the following URL must be used to manage the Azure Web Apps?

When you create a new website by using Web Apps in Azure, a default sitename.azurewebsites.net domain is assigned to your site. If you add a custom host name to your site and don't want users to be able to access your default *. azurewebsites.net domain, you can redirect the default URL.

What webserver does Azure use?

There are different HTTP server approaches in App Service for Windows and App Service for Linux. Azure App Service for Windows runs on IIS with the use of modules. Node. js apps in App Service on Windows are hosted with IISNode.


4 Answers

Surely it is possible to write on the file system of Azure Websites. However your write permissions are limited to the root folder of your app. So, if you use ASP.NET, you shall be able to write anywhere within the Server.MapPath("~/from_here_on"). Meaning you shall be able to perform read/write/delete operations on files which are located in the root folder of your app and below. If you use PHP, the root folder can be get from $_SERVER['DOCUMENT_ROOT'] environment variable.

And a web application shall not need more privileges. For sure will not be able to write on the operating system folders.

like image 153
astaykov Avatar answered Oct 18 '22 00:10

astaykov


Just as an additional information if someone encounters a could not find a part of the path ... error while writing: make sure that the folder you are writing to gets deployed. In my case it was an empty temporary directory which got skipped during deployment.

like image 36
Nico Avatar answered Oct 17 '22 22:10

Nico


I offer to use a blobs container instead to store permanent content that must be persisted regardless of virtual machines re-initialization or upgrades.

like image 2
Konstantin Isaev Avatar answered Oct 18 '22 00:10

Konstantin Isaev


You can write to the HOME environment variable location (%HOME% / $HOME) on Azure App Services. You can use Kudu or the app service's console to cd into this directory and explore it.

like image 2
Daniel Avatar answered Oct 17 '22 23:10

Daniel