What is BLOB ? –
Binary Large OBjects.
Windows Azure basically provides 4 type of storages
1) BLOB
2) Tables
3) Queues
4) Drive ( This is new) – NTFS drive.
In this Blog post i am going to use BLOB storage to store Binary Objects like Images , Videos , etc..
Blobs can be used to store data that is unstructured. Windows Azure account holder can create one or more containers to store related collections of blobs. Containers can be setup as either private or public. If a container is setup as public than any internet user will be able to read the blobs contained within it using the proper URL. If a container is marked as private than the secret key that comes with a Windows Azure storage account will be needed to access the blobs within the container. Additionally, if a single Blob is very large then Windows Azure provides tools to break up these large blobs into blocks so that they may be transferred to Windows Azure Blob storage more efficiently.
Container Rules
- Container name must be a valid Domain Name System (DNS) name, conforming to the following naming rules.
- Must start with a letter or number, and can contain only letters, numbers, and the period (.) and dash(-) characters.
- All letters must be lowercase.
- Must be from 3 to 63 characters long.
- A name cannot contain a dash next to a period.
The following screenshot shows the Methods of my Windows Azure Service project .Now we are going to create these methods and we will be using in ASP.NET Web UI to Upload the BLOB into Azure Storage. [Note: Here i am using my local Development Fabric ]
Here is the ASP.NET Web UI for this application.
First Run VS.NET 2010 as an Administrator and then create Cloud service project .
Now add ASP.NET Web Role to it. Open of Default.aspx Code behind file and Create CloudBlobClient private variable we will be using more often this.
InitBlobAccess:
This method Create a Local windows Azure Blob storage.
CreateContainer:
This method will create a container and set the access permission as public . [By default Windows Azure Blob storage permission is private. ]
DeleteContainer:
This method delete the container by given name.
ListBlobContainers:
This method returns all publicly accessible[ permission] containers.
ListBlob:
This method returns a List of all available Blobs for selected (given) container in Dropdown List.
Upload File:
This method will enumerate all the uploaded file and load the content into Selected container and create the Blob in Windows Azure Blog Storage.
Now wire up the above methods with ASP.NET WEB UI and upload the BLOB content and test it.
For more on Blob please visit http://blogs.msdn.com/windowsazure/archive/2009/11/25/windows-azure-storage-at-pdc-2009.aspx
Nandri(Thanks)
SreenivasaRagavan.
No comments:
Post a Comment