I'm new to Azure and I'm doing a small test:
I have a SQL Azure database and I use EF6.
I also have a cloud service which connects to the Azure database (a "Windows Azure Cloud Service" with 1 web role).
My service has 2 methods:
GetString()
: returns a string.GetUsers()
: return users from table[User]
in my Azure database (returnsIEnumerable<User>
)
When I call GetString()
it works fine.
when I call GetUsers()
I get the following error:
The underlying connection was closed: The connection was closed unexpectedly.
I've also tried using the WCF Test Client and get the same error.
When I create a console app which connects to my SQL Azure (with the same connection string), everything works fine and I get a list of my users from the database.
The problem only happens when connecting to the database from within the Azure service.
My SQL Azure is configured to allow WINDOWS AZURE SERVICES.
Any ideas?
Thanks!
** UPDATE **
When I use the service locally I get the following error while calling GetUsers:
An error occurred while receiving the HTTP response to localhost:50119/MyService.svc. This could be due to the service endpoint binding not using the HTTP protocol. This could also be due to an HTTP request context being aborted by the server (possibly due to the service shutting down). See server logs for more details.