I feel the way you're trying to do is wrong.So you can use below mentioned methods for do your task.I have mentioned very useful link with this post.Check that also.
How to: Programmatically access blob storage ?
Retrieving your connection string
Method 1 : You can use the CloudStorageAccount type to represent your Storage Account information is as below.
CloudStorageAccount storageAccount = CloudStorageAccount.Parse(
CloudConfigurationManager.GetSetting("StorageConnectionString"));
Method 2 : If you are creating an application with no reference to Microsoft.WindowsAzure.CloudConfigurationManager
, and your connection string is located in the web.config
or app.config
then,
using System.Configuration;
...
CloudStorageAccount storageAccount = CloudStorageAccount.Parse(
ConfigurationManager.ConnectionStrings["StorageConnectionString"].ConnectionString);
You can have great amount of information by using How to use the Windows Azure Blob Storage Service in .NET
I hope this will help to you.