I am receiving an error when trying to get a container reference using the Azure storage API.
I can connect to my Azure storage account from the server explorer in Visual Studio. I can also connect from a test C# client I wrote, using the following code:
StorageCredentialsAccountAndKey credentials = new StorageCredentialsAccountAndKey("ACCOUNT", "XXXX")
CloudStorageAccount account = new CloudStorageAccount(credentials, true);
CloudBlobClient blobClient = account.CreateCloudBlobClient();
CloudBlobContainer container = blobClient.GetContainerReference(name);
container.CreateIfNotExist();
I created an ASP.NET MVC (Web API) application, and hosted it using IIS Express. I put the same code as above in a web method, and when I call this method from a client it does not work. It gets to the last line CreateIfNotExist(), waits a few minutes, and throws a System.Net.WebException error saying "Unable to connect to the remote server" ... "No connection could be made because the target machine actively refused it 168.63.33.206:443".
I find it strange that I can connect through other methods but not when I use local web application. Can anyone help? I've crawled the internet but can't find anyone with the same problem or with a decent solution.
Many thanks.