I found a bug in the October release of the Azure SDK.
If you try to use the CloudStorageAccount.Parse() method with a connection string of UseDevelopmentServer=true, the October release of the Azure SDK (2.0.0.0) throws a ‘Key not present in dictionary’ exception.
This is a bug in the SDK (it is expecting the DevelopmentStorageProxyUri in the connection string). The workarounds are,
1. Dont use the emulator
2. Setup a proxy and pass the DevelopmentStorageProxyUri as part of the connection string
3. Use the CloudStorageAccount.DevelopmentStorageAccount property instead
Number 3 is easiest for a quick workaround. I ended up doing this,
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
public static CloudStorageAccount CreateCloudStorageAccount() { CloudStorageAccount result; if (System.Configuration.ConfigurationManager.AppSettings["AzureStorageConnectionString"] == "UseDevelopmentStorage=true") { result = CloudStorageAccount.DevelopmentStorageAccount; } else { result = CloudStorageAccount.Parse(System.Configuration.ConfigurationManager.AppSettings["AzureStorageConnectionString"]); } return result; } |
Pretty lame but it got everyone up and running with minimal environment changes.