<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Azure Storage And WordPress &#8211; Sibeesh Passion</title>
	<atom:link href="https://sibeeshpassion.com/tag/azure-storage-and-wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>https://sibeeshpassion.com</link>
	<description>My passion towards life</description>
	<lastBuildDate>Mon, 29 May 2017 16:09:25 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>/wp-content/uploads/2017/04/Sibeesh_Passion_Logo_Small.png</url>
	<title>Azure Storage And WordPress &#8211; Sibeesh Passion</title>
	<link>https://sibeeshpassion.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Upload Contents To Azure Container, CDN in WordPress Folder Format</title>
		<link>https://sibeeshpassion.com/upload-contents-to-azure-container-cdn-in-wordpress-folder-format/</link>
					<comments>https://sibeeshpassion.com/upload-contents-to-azure-container-cdn-in-wordpress-folder-format/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Mon, 29 May 2017 16:09:25 +0000</pubDate>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[Azure CDN]]></category>
		<category><![CDATA[How to]]></category>
		<category><![CDATA[Azure Blobs With Hierarchy Folders]]></category>
		<category><![CDATA[Azure Storage And WordPress]]></category>
		<category><![CDATA[Azure With WordPress]]></category>
		<guid isPermaLink="false">http://sibeecst_passion.com/?p=12411</guid>

					<description><![CDATA[[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&#8217;t need to worry about it, there is always [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>[toc]</p>
<h3>Introduction</h3>
<p>Here, in this article we are going to a see how we upload contents to our <a href="http://sibeeshpassion.com/category/Azure" target="_blank">Azure </a>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 <em>wwwroot/wp-content/uploads/2017/05/</em>. The real problem is, we can not create a container inside a container. Yeah, you heard it right. But, you don&#8217;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&#8217;s begin.</p>
<h3>Background</h3>
<p>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.</p>
<div id="attachment_12413" style="width: 644px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2017/05/No-option-to-upload-a-container-inside-a-container.png"><img fetchpriority="high" decoding="async" aria-describedby="caption-attachment-12413" src="http://sibeeshpassion.com/wp-content/uploads/2017/05/No-option-to-upload-a-container-inside-a-container.png" alt="No option to upload a container inside a container" width="634" height="209" class="size-full wp-image-12413" srcset="/wp-content/uploads/2017/05/No-option-to-upload-a-container-inside-a-container.png 634w, /wp-content/uploads/2017/05/No-option-to-upload-a-container-inside-a-container-300x99.png 300w, /wp-content/uploads/2017/05/No-option-to-upload-a-container-inside-a-container-400x132.png 400w" sizes="(max-width: 634px) 100vw, 634px" /></a><p id="caption-attachment-12413" class="wp-caption-text">No option to upload a container inside a container</p></div>
<p>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. </p>
<p>In this post, we are going to see two possible solution we can use. </p>
<li>Use &#8220;/&#8221; in the Azure blob </li>
<li>Upload the folders via tools like Storage Explorer </li>
<h3>Use &#8220;/&#8221; in the Azure blob</h3>
<p>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 <em>wwwroot/wp-content/uploads/2017/05/</em>. 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</p>
<li>/sibeeshpassion.png</li>
<li>/2017/01//sibeeshpassion.png</li>
<li>/wp-content/uploads/2017/01/sibeeshpassion.png</li>
<p>You can follow <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/naming-and-referencing-containers--blobs--and-metadata" target="_blank">this post</a> for getting more information abut this.  </p>
<h3>Upload the folders via tools like Storage Explorer</h3>
<p>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&#8217;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. </p>
<p>To get started, you will have to download the tool <a href="http://storageexplorer.com/" target="_blank">Microsoft Azure Storage Explorer</a>, once you download, please install it and open it.</p>
<p>Now, add your Azure account in Storage Explorer.</p>
<div id="attachment_12414" style="width: 644px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2017/05/Add-Account-in-Microsoft-Azure-Storage-Explorer.png"><img decoding="async" aria-describedby="caption-attachment-12414" src="http://sibeeshpassion.com/wp-content/uploads/2017/05/Add-Account-in-Microsoft-Azure-Storage-Explorer.png" alt="Add Account in Microsoft Azure Storage Explorer" width="634" height="490" class="size-full wp-image-12414" srcset="/wp-content/uploads/2017/05/Add-Account-in-Microsoft-Azure-Storage-Explorer.png 462w, /wp-content/uploads/2017/05/Add-Account-in-Microsoft-Azure-Storage-Explorer-300x232.png 300w, /wp-content/uploads/2017/05/Add-Account-in-Microsoft-Azure-Storage-Explorer-400x309.png 400w" sizes="(max-width: 634px) 100vw, 634px" /></a><p id="caption-attachment-12414" class="wp-caption-text">Add Account in Microsoft Azure Storage Explorer</p></div>
<p>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&#8217;s create and name our container as wp-content.</p>
<div id="attachment_12415" style="width: 318px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2017/05/Creating-a-BLOB-Container.png"><img decoding="async" aria-describedby="caption-attachment-12415" src="http://sibeeshpassion.com/wp-content/uploads/2017/05/Creating-a-BLOB-Container.png" alt="Creating a BLOB Container" width="308" height="201" class="size-full wp-image-12415" srcset="/wp-content/uploads/2017/05/Creating-a-BLOB-Container.png 308w, /wp-content/uploads/2017/05/Creating-a-BLOB-Container-300x196.png 300w" sizes="(max-width: 308px) 100vw, 308px" /></a><p id="caption-attachment-12415" class="wp-caption-text">Creating a BLOB Container</p></div>
<p>Now what is pending from our end is, uploading the folders. Let&#8217;s create one sample folder with one image.</p>
<div id="attachment_12416" style="width: 489px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2017/05/Files-and-Folders-to-Upload.png"><img decoding="async" aria-describedby="caption-attachment-12416" src="http://sibeeshpassion.com/wp-content/uploads/2017/05/Files-and-Folders-to-Upload.png" alt="Files and Folders to Upload" width="479" height="187" class="size-full wp-image-12416" srcset="/wp-content/uploads/2017/05/Files-and-Folders-to-Upload.png 479w, /wp-content/uploads/2017/05/Files-and-Folders-to-Upload-300x117.png 300w, /wp-content/uploads/2017/05/Files-and-Folders-to-Upload-400x156.png 400w" sizes="(max-width: 479px) 100vw, 479px" /></a><p id="caption-attachment-12416" class="wp-caption-text">Files and Folders to Upload</p></div>
<p>Now click on the upload button and select the root folder you need to upload.</p>
<div id="attachment_12417" style="width: 517px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2017/05/Select-the-Folder-to-be-Uploaded.png"><img decoding="async" aria-describedby="caption-attachment-12417" src="http://sibeeshpassion.com/wp-content/uploads/2017/05/Select-the-Folder-to-be-Uploaded.png" alt="Select the Folder to be Uploaded" width="507" height="344" class="size-full wp-image-12417" srcset="/wp-content/uploads/2017/05/Select-the-Folder-to-be-Uploaded.png 507w, /wp-content/uploads/2017/05/Select-the-Folder-to-be-Uploaded-300x204.png 300w, /wp-content/uploads/2017/05/Select-the-Folder-to-be-Uploaded-320x218.png 320w, /wp-content/uploads/2017/05/Select-the-Folder-to-be-Uploaded-160x110.png 160w, /wp-content/uploads/2017/05/Select-the-Folder-to-be-Uploaded-400x271.png 400w" sizes="(max-width: 507px) 100vw, 507px" /></a><p id="caption-attachment-12417" class="wp-caption-text">Select the Folder to be Uploaded</p></div>
<p>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.</p>
<div id="attachment_12418" style="width: 731px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2017/05/Select-the-Uploaded-Files-e1495893001229.png"><img decoding="async" aria-describedby="caption-attachment-12418" src="http://sibeeshpassion.com/wp-content/uploads/2017/05/Select-the-Uploaded-Files-e1495893001229.png" alt="Select the Uploaded Files" width="721" height="185" class="size-full wp-image-12418" srcset="/wp-content/uploads/2017/05/Select-the-Uploaded-Files-e1495893001229.png 634w, /wp-content/uploads/2017/05/Select-the-Uploaded-Files-e1495893001229-300x77.png 300w, /wp-content/uploads/2017/05/Select-the-Uploaded-Files-e1495893001229-400x103.png 400w" sizes="(max-width: 721px) 100vw, 721px" /></a><p id="caption-attachment-12418" class="wp-caption-text">Select the Uploaded Files</p></div>
<p>Now if you just copy the file URL and open it in the browser, you can see the content you have just uploaded.</p>
<blockquote><p>
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: <a href="http://sibeeshpassion.com/fix-for-404-resourcenotfound-error-after-uploading-to-azure-container/" target="_blank">Fix For 404 ResourceNotFound Error After Uploading to Azure Container</a>
</p></blockquote>
<p>Just for the reference you can always login to your Azure portal and check the blob, there you can find the hierarchical blob.</p>
<div id="attachment_12420" style="width: 644px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2017/05/Hierarchy-Folder-Structure-in-Azure-Storage-Container.png"><img decoding="async" aria-describedby="caption-attachment-12420" src="http://sibeeshpassion.com/wp-content/uploads/2017/05/Hierarchy-Folder-Structure-in-Azure-Storage-Container.png" alt="Hierarchy Folder Structure in Azure Storage Container" width="634" height="339" class="size-full wp-image-12420" srcset="/wp-content/uploads/2017/05/Hierarchy-Folder-Structure-in-Azure-Storage-Container.png 634w, /wp-content/uploads/2017/05/Hierarchy-Folder-Structure-in-Azure-Storage-Container-300x160.png 300w, /wp-content/uploads/2017/05/Hierarchy-Folder-Structure-in-Azure-Storage-Container-400x214.png 400w" sizes="(max-width: 634px) 100vw, 634px" /></a><p id="caption-attachment-12420" class="wp-caption-text">Hierarchy Folder Structure in Azure Storage Container</p></div>
<p>Thanks for reading, I will come back with another article which explore Azure CDN. Happy Uploading!.</p>
<h3>Conclusion</h3>
<p>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.</p>
<h3>Your turn. What do you think?</h3>
<p>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.</p>
<p>Kindest Regards<br />
Sibeesh Venu</p>
]]></content:encoded>
					
					<wfw:commentRss>https://sibeeshpassion.com/upload-contents-to-azure-container-cdn-in-wordpress-folder-format/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
