1
votes

In VisualStudio 2017 and 2015 when I attempt CreateIfNotExists() with CloudBlobClient "UseDevelopmentStorage=true" I am getting a 400 Bad Request. When I change the connection to point to a live Azure storage account, it works

open Microsoft.WindowsAzure
open Microsoft.WindowsAzure.Storage
open Microsoft.WindowsAzure.Storage.Blob
let storageAccount = CloudStorageAccount.Parse("UseDevelopmentStorage=true;DevelopmentStorageProxyUri=http://127.0.0.1;")
    //let storageAccount = CloudStorageAccount.Parse("UseDevelopmentStorage=true")  //also tried formatting the connection string this way
    //let storageAccount = CloudStorageAccount.Parse("UseDevelopmentStorage=true;DevelopmentStorageProxyUri=http://127.0.0.1:10000;") //also tried this
let blobClient = storageAccount.CreateCloudBlobClient()
let container = blobClient.GetContainerReference("contactinput")
container.CreateIfNotExists() 
|> ignore

Previous questions on this topic were resolved by

1) improper container name, usually capital letters

(that is not the case here, especially since it works pointing to live Azure storage)

2) issue with local development storage not starting properly

(that is not the case here, as I can connect to local storage through the Microsoft Storage Explorer and even inside Visual Studio through the Server Explorer)

3) incompatibility between emulator, SDK, and storage DLL

(recommended solution is "get latest")

This is my set-up:

Azure .NET SDK v2.9

Windows Azure Storage Emulator 5.1.0.0

Microsoft.WindowsAzure.Storage DLL 8.3.0

As best I can tell these are all current, except there is an SDK v2.9.6. I'm having trouble finding a link to download this version of the SDK, all the online links seem to point me to a full VS2017 install.

It's unlikely such a minor SDK revision would be the source of my problem anyway. Any other suggestions as to what my problem could be?

2

2 Answers

3
votes

The latest storage emulator version is 5.2, which provides support for the most recent service version used by storage client 8.3. You can get the latest version here:

https://go.microsoft.com/fwlink/?LinkId=717179&clcid=0x409

0
votes

Personally I use

CloudStorageAccount storageAccount = CloudStorageAccount.DevelopmentStorageAccount

to set up development account because it makes sure everything is set up correctly, also be sure that every container is lowercase, I was getting a 400 bad request error because I was sending out a request for "testContainer", the error stopped showing up when I used "testcontainer" instead.