I am trying to access Azure Storage from a console app like this:
CloudStorageAccount storageAccount = CloudStorageAccount.FromConfigurationSetting("myConnectionString");
where the connection string is something like:
DefaultEndpointsProtocol=https;AccountName=XXX;AccountKey=XXX
but i get an exception:
System.Runtime.InteropServices.SEHException was caught Message=External component has thrown an exception. Source=msshrtmi ErrorCode=-2147467259
StackTrace:
at RoleEnvironmentGetConfigurationSettingValueW(UInt16* , UInt16* , UInt64 , UInt64* )
at Microsoft.WindowsAzure.ServiceRuntime.Internal.InteropRoleManager.GetConfigurationSetting(String name, String& ret)
at Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.GetConfigurationSettingValue(String configurationSettingName)
at AzureUpload.Program.<Init>b__2(String configName, Func`2 configSetter) in C:\Users\siddjain\Documents\Visual Studio 2010\Projects\ConsoleAplication1\Program.cs:line 51
at Microsoft.WindowsAzure.CloudStorageAccount.StorageAccountConfigurationSetting..ctor(String configurationSettingName)
at Microsoft.WindowsAzure.CloudStorageAccount.FromConfigurationSetting(String settingName)
at AzureUpload.Program.UploadBlob(String directory, String searchPattern, String container) in C:\Users\siddjain\Documents\Visual Studio 2010\Projects\ConsoleApplication1\Program.cs:line 87
InnerException
Do I need to start up azure services or something before running my app?