Search code examples
c#azureazure-storageazure-storage-emulator

Windows Azure ends connection and returns a 324 error code


I have tried some labs in Windows Azure and it works fine. So, I start developing my application with Azure Emulator.

I perform my first deployment test today in Windows Azure and have a first issue:

No connection could be made because the target machine actively refused it 127.0.0.1:10000

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 127.0.0.1:10000

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace: 


[SocketException (0x274d): No connection could be made because the target machine actively refused it 127.0.0.1:10000]
   System.Net.Sockets.Socket.EndConnect(IAsyncResult asyncResult) +2724507
   System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception) +392

[WebException: Unable to connect to the remote server]
   Microsoft.WindowsAzure.StorageClient.Tasks.Task`1.get_Result() +96
   Microsoft.WindowsAzure.StorageClient.Tasks.Task`1.ExecuteAndWait() +271
   Microsoft.WindowsAzure.StorageClient.CloudBlobContainer.Delete(BlobRequestOptions options) +213
   MyProject.Web.MvcApplication.InitBlobs() in C:\Sites\MyProject\MyProject\MyProject.Web\Global.asax.cs:85
   MyProject.Web.MvcApplication.Application_Start() in C:\Sites\MyProject\MyProject\MyProject.Web\Global.asax.cs:52

It was the first deployment, so I tried to delete a container that doesn't exist. I now handle the Exception.

I redeploy my project and doesn't get any server error. It just ends the connection and leave me this error: Error 324 (net::ERR_EMPTY_RESPONSE)

I assume I miss something in my configuration but I wasn't able to find what it is exactly.

Thank you for your help!

Edit: The deployment itself is the first one for this application, but it isn't the first one I perform on Windows Azure. I already deployed some msdn labs when I start developing for Windows Azure.


Solution

  • Ok, I figured out what my mistake was.

    In my desire of abstraction, I designed a solution where I used the blob connection only a very few time in my app. There was 3 call to the blob storage.

    • One in my Global.asax
    • One in a BlobService
    • One in an ExtensionMethod

    I checked several times my Global.asax and BlobService but forgot the ExtensionMethod. I wrote it in the beginning of my project and I was accessing my blob account only in development by the following instruction: CloudStorageAccount.DevelopmentStorageAccount instead of CloudStorageAccount.Parse(RoleEnvironment.GetConfigurationSettingValue("BlobConnection"))

    Chris Koening answer was partially right, because I was trying to access development storage whereas I was in the Cloud. If you have the same problem describe in this question, my advise would be:

    1. Execute Chris answer
    2. If it doesn't solve your issue, try to find the DevelopmentStorageAccount string in your entire solution via Visual Studio search tool or Agent Ransack and replace it with the key you defined in first step
    3. If it still doesn't solve your issue, try to find if there is any reference to the DevelopmentStorage anywhere else