You don t need Azure project or other roles to use blob. If you want to use Azure client in .Net project, you can add your config to app settings section and reference it. Azure client is a wrapper to rest calls. They have some request signing steps which make the calls difficult to implement with simple webrequests.
<add key="AzureBlobStorage" value="AccountName=youraccountname;AccountKey=YOURKEYeZgfgdfg==;DefaultEndpointsProtocol=https"/>
You can get the blob client:
public CloudBlobClient GetBlobClient()
{
var accountBlob = ConfigurationManager.AppSettings["AzureBlobStorage"];
var account = CloudStorageAccount.Parse(accountBlob.ToString());
return account.CreateCloudBlobClient();
}
public CloudBlob GetBlob(BlobItem blobItem)
{
var client = GetBlobClient();
var cloudBlobContainer = client.GetContainerReference(blobItem.ContainerReference);
return cloudBlobContainer.GetBlobReference(blobItem.FileName);
}
BlobItem is just a wrapper. Basically, you need folder name and filename to access a blob.
public class BlobItem
{
[Required]
[Display(Name = "Container")]
public string ContainerReference { get; set; }
[Required]
[Display(Name = "File name")]
public string FileName { get; set; }
[Required]
[UIHint("MultilineText")]
public string Content { get; set; }
/// <summary>
/// to use in stream mode
/// </summary>
public Stream Stream { get; set; }
}