Sibeesh Passion

Top Menu

  • Home
  • Search
  • About
  • Privacy Policy

Main Menu

  • Articles
    • Azure
    • .NET
    • IoT
    • JavaScript
    • Career Advice
    • Interview
    • Angular
    • Node JS
    • JQuery
    • Knockout JS
    • Jasmine Framework
    • SQL
    • MongoDB
    • MySQL
    • WordPress
  • Contributions
    • Medium
    • GitHub
    • Stack Overflow
    • Unsplash
    • ASP.NET Forum
    • C# Corner
    • Code Project
    • DZone
    • MSDN
  • Social Media
    • LinkedIn
    • Facebook
    • Instagram
    • Twitter
  • YouTube
    • Sibeesh Venu
    • Sibeesh Passion
  • Awards
  • Home
  • Search
  • About
  • Privacy Policy

logo

Sibeesh Passion

  • Articles
    • Azure
    • .NET
    • IoT
    • JavaScript
    • Career Advice
    • Interview
    • Angular
    • Node JS
    • JQuery
    • Knockout JS
    • Jasmine Framework
    • SQL
    • MongoDB
    • MySQL
    • WordPress
  • Contributions
    • Medium
    • GitHub
    • Stack Overflow
    • Unsplash
    • ASP.NET Forum
    • C# Corner
    • Code Project
    • DZone
    • MSDN
  • Social Media
    • LinkedIn
    • Facebook
    • Instagram
    • Twitter
  • YouTube
    • Sibeesh Venu
    • Sibeesh Passion
  • Awards
  • Linux Azure Function Isolated Dot Net 9 YAML Template Deployment

  • Build, Deploy, Configure CI &CD Your Static Website in 5 mins

  • Post Messages to Microsoft Teams Using Python

  • Get Azure Blob Storage Blob Metadata Using PowerShell

  • Deploy .net 6 App to Azure from Azure DevOps using Pipelines

AzureAzure CDNHow to
Home›Azure›Upload Contents To Azure Container, CDN in WordPress Folder Format

Upload Contents To Azure Container, CDN in WordPress Folder Format

By SibeeshVenu
May 29, 2017
1968
0
Share:
Creating a BLOB Container

[toc]

Introduction

Here, in this article we are going to a see how we upload contents to our Azure container in our CDN storage in a WordPress folder format. You may be thinking what is so special in WrdPress folder format, what makes the difference in other formats? When I say WordPress folder format, I mean one folder in an another folder. In WordPress we usually have the structure as wwwroot/wp-content/uploads/2017/05/. The real problem is, we can not create a container inside a container. Yeah, you heard it right. But, you don’t need to worry about it, there is always few ways we can achieve this need, in this post I am going to show you that. I hope you will like this. Now let’s begin.

Background

I recently created a Azure CDN for my website, and when I was just trying to upload the files to my Azure storage, I got stuck with the problem, that we can not create a container inside a container.

No option to upload a container inside a container

No option to upload a container inside a container

If it is possible, changing URLs of my entire images and other contents would have been pretty much easier, hope you know what I mean? We could have just uploaded the root folder and change the main URL to our CDN endpoint. In my case, change the URL http://sibeeshpassion.com/ to http://cdn.sibeeshpassion.com/ could fix the issues, and with some plugins, we can easily do that.

In this post, we are going to see two possible solution we can use.

  • Use “/” in the Azure blob
  • Upload the folders via tools like Storage Explorer
  • Use “/” in the Azure blob

    One good thing here is we can always create virtual folders by having the “/” character as a delimiter/part of the blob name to build the hierarchy we need. In our case it is wwwroot/wp-content/uploads/2017/05/. Though the Blob service in Azure storage is based on flat storage scheme, not a hierarchical scheme, we can still specify a character or string delimiter within a blob name to create a virtual hierarchy. For example, we can always create unique blobs as preceding

  • /sibeeshpassion.png
  • /2017/01//sibeeshpassion.png
  • /wp-content/uploads/2017/01/sibeeshpassion.png
  • You can follow this post for getting more information abut this.

    Upload the folders via tools like Storage Explorer

    This step is pretty much easier than the above mentioned way. Here we are going use the tools like Storage Explorer to do the task for us. Uploading each contents manually and renaming them in hierarchical format would be a tough task, am I right? If you are having around 20-50 images or contents in your site, that won’t be a problem. But my case was bit different, as I had around 5000 images and other contents, so I personally selected this method.

    To get started, you will have to download the tool Microsoft Azure Storage Explorer, once you download, please install it and open it.

    Now, add your Azure account in Storage Explorer.

    Add Account in Microsoft Azure Storage Explorer

    Add Account in Microsoft Azure Storage Explorer

    Once you add your account, the tool wish list down all of your storage and resources you have with that account. Now go to your storage account and create a container. Let’s create and name our container as wp-content.

    Creating a BLOB Container

    Creating a BLOB Container

    Now what is pending from our end is, uploading the folders. Let’s create one sample folder with one image.

    Files and Folders to Upload

    Files and Folders to Upload

    Now click on the upload button and select the root folder you need to upload.

    Select the Folder to be Uploaded

    Select the Folder to be Uploaded

    Once you are done uploading, I am sure that you can see those files in your storage account. Please be noted that it follows the same hierarchy we needed.

    Select the Uploaded Files

    Select the Uploaded Files

    Now if you just copy the file URL and open it in the browser, you can see the content you have just uploaded.

    Please be noted that, the default access policy of a container is private, thus you will not be able to load the contents via browser. Most probably you will be getting a 404 error. To fix this you will have to change the access policy wither to blob or container. You can follow this post: Fix For 404 ResourceNotFound Error After Uploading to Azure Container

    Just for the reference you can always login to your Azure portal and check the blob, there you can find the hierarchical blob.

    Hierarchy Folder Structure in Azure Storage Container

    Hierarchy Folder Structure in Azure Storage Container

    Thanks for reading, I will come back with another article which explore Azure CDN. Happy Uploading!.

    Conclusion

    Did I miss anything that you may think which is needed? Could you find this post as useful? I hope you liked this article. Please share me your valuable suggestions and feedback.

    Your turn. What do you think?

    A blog isn’t a blog without comments, but do try to stay on topic. If you have a question unrelated to this post, you’re better off posting it on C# Corner, Code Project, Stack Overflow, Asp.Net Forum instead of commenting here. Tweet or email me a link to your question there and I’ll definitely try to help if I can.

    Kindest Regards
    Sibeesh Venu

    TagsAzureAzure Blobs With Hierarchy FoldersAzure CDNAzure Storage And WordPressAzure With WordPress
    Previous Article

    Azure Content Delivery Network (CDN) – A ...

    Next Article

    Custom Stylish Handlebar Mirror in Royal Enfield ...

    0
    Shares
    • 0
    • +
    • 0
    • 0
    • 0

    SibeeshVenu

    I am Sibeesh Venu, an engineer by profession and writer by passion. Microsoft MVP, Author, Speaker, Content Creator, Youtuber, Programmer.

    Related articles More from author

    • Azure

      Linux Azure Function Isolated Dot Net 9 YAML Template Deployment

      April 27, 2025
      By SibeeshVenu
    • AzureHow to

      Fix for 404 ResourceNotFound Error After Uploading to Azure Container

      May 27, 2017
      By SibeeshVenu
    • Azure

      TimerTrigger Azure Function to Upload to Azure Blob Daily

      July 17, 2019
      By SibeeshVenu
    • Azure

      Configuring Mobile Services In Microsoft Azure

      March 29, 2015
      By SibeeshVenu
    • Install MySQL in Azure Virtual Machine
      AzureMySQLVirtual Machine

      Install MySQL in Azure Virtual Machine

      September 18, 2015
      By SibeeshVenu
    • AzureVideos

      Encrypt an Azure Virtual Machine VHD File in 5 Minutes

      September 3, 2019
      By SibeeshVenu
    0

    My book

    Asp Net Core and Azure with Raspberry Pi Sibeesh Venu

    YouTube

    MICROSOFT MVP (2016-2022)

    profile for Sibeesh Venu - Microsoft MVP

    Recent Posts

    • Linux Azure Function Isolated Dot Net 9 YAML Template Deployment
    • Build, Deploy, Configure CI &CD Your Static Website in 5 mins
    • Easily move data from one COSMOS DB to another
    • .NET 8 New and Efficient Way to Check IP is in Given IP Range
    • Async Client IP safelist for Dot NET
    • Post Messages to Microsoft Teams Using Python
    • Get Azure Blob Storage Blob Metadata Using PowerShell
    • Deploy .net 6 App to Azure from Azure DevOps using Pipelines
    • Integrate Azure App Insights in 1 Minute to .Net6 Application
    • Azure DevOps Service Connection with Multiple Azure Resource Group

    Tags

    Achievements (35) Angular (14) Angular 5 (7) Angular JS (15) article (10) Article Of The Day (13) Asp.Net (14) Azure (65) Azure DevOps (10) Azure Function (10) Azure IoT (7) C# (17) c-sharp corner (13) Career Advice (11) chart (11) CSharp (7) CSS (7) CSS3 (6) HighChart (10) How To (9) HTML5 (10) HTML5 Chart (11) Interview (6) IoT (11) Javascript (10) JQuery (82) jquery functions (9) JQWidgets (15) JQX Grid (17) Json (7) Microsoft (8) MVC (20) MVP (9) MXChip (7) News (18) Office 365 (7) Products (10) SQL (20) SQL Server (15) Visual Studio (10) Visual Studio 2017 (7) VS2017 (7) Web API (12) Windows 10 (7) Wordpress (9)
    • .NET
    • Achievements
    • ADO.NET
    • Android
    • Angular
    • Arduino
    • Article Of The Day
    • ASP.NET
    • Asp.Net Core
    • Automobile
    • Awards
    • Azure
    • Azure CDN
    • azure devops
    • Blockchain
    • Blog
    • Browser
    • C-Sharp Corner
    • C#
    • Career Advice
    • Code Snippets
    • CodeProject
    • Cognitive Services
    • Cosmos DB
    • CSS
    • CSS3
    • Data Factory
    • Database
    • Docker
    • Drawings
    • Drill Down Chart
    • English
    • Excel Programming
    • Exporting
    • Facebook
    • Fun
    • Gadgets
    • GitHub
    • GoPro
    • High Map
    • HighChart
    • How to
    • HTML
    • HTML5
    • Ignite UI
    • IIS
    • Interview
    • IoT
    • JavaScript
    • JQuery
    • jQuery UI
    • JQWidgets
    • JQX Grid
    • Json
    • Knockout JS
    • Linux
    • Machine Learning
    • Malayalam
    • Malayalam Poems
    • MDX Query
    • Microsoft
    • Microsoft ADOMD
    • Microsoft MVP
    • Microsoft Office
    • Microsoft Technologies
    • Microsoft Windows
    • Microsoft Windows Server
    • Mobile
    • MongoDB
    • Monthly Winners
    • MVC
    • MVC Grid
    • MySQL
    • News
    • Node JS
    • npm
    • Number Conversions
    • October 2015
    • Office 365
    • Office Development
    • One Plus
    • Outlook
    • Page
    • PHP
    • Poems
    • PowerShell
    • Products
    • Q&A
    • Raspberry PI
    • React
    • SEO
    • SharePoint
    • Skype
    • Social Media
    • Software
    • Spire.Doc
    • Spire.PDF
    • Spire.XLS
    • SQL
    • SQL Server
    • SSAS
    • SSMS
    • Storage In HTML5
    • Stories
    • Third Party Software Apps
    • Tips
    • Tools
    • Translator Text
    • Uncategorized
    • Unit Testing
    • UWP
    • VB.Net
    • Videos
    • Virtual Machine
    • Visual Studio
    • Visual Studio 2017
    • Wamp Server
    • Web API
    • Web Platform Installer
    • Webinars
    • WebMatrix
    • Windows 10
    • Windows 7
    • Windows 8.1
    • Wordpress
    • Writing

    ABOUT ME

    I am Sibeesh Venu, an engineer by profession and writer by passion. Microsoft MVP, Author, Speaker, Content Creator, Youtuber, Programmer. If you would like to know more about me, you can read my story here.

    Contact Me

    • info@sibeeshpassion.com

    Pages

    • About
    • Search
    • Privacy Policy
    • About
    • Search
    • Privacy Policy
    © Copyright Sibeesh Passion 2014-2025. All Rights Reserved.
    Go to mobile version