Recently I have just started to manage a wiki (pukiwiki) site on Azure Web App, which also runs another MVC application. Below is the conceptual structure.
--site/
--wwwroot/
--<main app>
--wiki/
--attach/ //attached files
--lib/ //php codes
--image/ //images
--<other folders>
--index.php
--pukiwiki.ini
--.htaccess
--<other files>
It works well, however, my wiki is designed to contain many images and articles so it will be a problem that the storage of the wiki will affect to the total disk space of my web app.
Then I thought it would be a way to move the folders listed above to Azure Blob Storage.
index.php and wiki.ini have some requirements of php codes which are located in lib, attach and other folders and there are also definitions which determines the location of the folders.
//index.php
define('DATA_HOME', '');
define('LIB_DIR', 'lib/');
require(LIB_DIR . 'pukiwiki.php');
//pukiwiki.ini
define('DATA_DIR', DATA_HOME . 'wiki/' );
define('UPLOAD_DIR', DATA_HOME . 'attach/' );
...
I moved the folders to the blob and edited those reference to refer the location there.
//index.php
define('DATA_HOME', 'https://<account>.blob.core.windows.net/wiki/<container>/');
define('LIB_DIR', 'lib/');
require(LIB_DIR . 'pukiwiki.php');
//pukiwiki.ini
define('DATA_DIR', DATA_HOME . 'wiki/' );
define('UPLOAD_DIR', DATA_HOME . 'attach/' );
...
However, due to the restriction on referring to another domain, it doesn't work. Allowing accesses to the domain by editing .user.ini would be a solution but it didn't look recommended in point of security as I saw.
Is there any good idea to reduce the disk space for the wiki contents?
Regarding "is there any good idea to reduce disk space" - that's subjective and broad. However, from an objective perspective, what you're doing is incorrect.
You're trying to treat a blob container like a file directory, and it doesn't work that way. Blobs are accessed through a REST API (or one of the language-specific SDK's).
If you require having a separate, larger storage area for Web Apps (without modifying your code to work specifically with blob storage), you'd have to do one of the following:
There's always the option of storing content outside of your Web App (e.g. database, direct blob access, etc.). But that'll be specific to your wiki software in how you set that up.