MatthewWoodward-3490 avatar image
0 Votes"
MatthewWoodward-3490 asked MatthewWoodward-3490 commented

Use Azure File Share as Uploads Directory for WordPress in Docker

Hi there -- I'm semi-new to Azure and am trying to figure out the best way to run a WordPress site, but use an Azure File Share as the uploads directory.

Thus far I've pushed my WordPress image up to the Azure Container Registry and have it running in an App Service, and at a basic level that's working great.

I then went into the app service configuration and added a path mapping pointing to the Azure File Share, and set the mount point as /var/www/html/wp-content/media. I also added define( 'UPLOADS', 'wp-content/media' ); to the WORDPRESS_CONFIG_EXTRA application setting, and also added WEBSITES_ENABLE_APP_SERVICE_STORAGE with a value of TRUE as an application setting.

When I upload a test image the upload works, and the file shows up in the file share, but the image doesn't appear in the media library in the admin (there's a box but it's empty), and when I try to browse to the URL for the image directly I get a 502 error.

I'm assuming it has something to do with perhaps needing a location defined at the web server level, but if I'm using the stock Docker WordPress image, I wasn't sure how best to go about doing that and my Google fu is failing me.

As a broader question, is the approach I'm taking of using a path mapping to the Azure File Share even the best way to do this? Am I better off setting up the File Share as a CDN and using a CDN plugin instead? Writing directly to the filesystem seemed to be the more direct route, but I'd love to learn from the experience of others who've done this.


· 4
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.

@MatthewWoodward-3490 Firstly, apologies for the delay in responding here and any inconvenience this issue may have caused. I am looking into this thread

1 Vote 1 ·

Thanks! If it helps, I outlined things as clearly as I could on StackOverflow as well:

0 Votes 0 ·
Sumarigo-MSFT avatar image Sumarigo-MSFT MatthewWoodward-3490 ·

@MatthewWoodward-3490 I wish to engage with you offline for a closer look and provide a quick and specialized assistance, please send an email with subject line “Attn:subm” to AzCommunity[at]Microsoft[dot]com referencing this thread and the Azure subscription ID, I will follow-up with you. Once again, apologies for any inconvenience with this issue.

Thanks for your patience and co-operation.

1 Vote 1 ·
Show more comments

0 Answers