The other day, a colleague got in touch with me looking for help in getting a WCF service working in an Azure WorkerRole. It would work locally, but not deployed in the cloud. This is a common problem I’ve run into – for example, calling Open() on a ServiceHost will work locally, but no in the cloud due to permissions.
I wasn’t much help in getting John’s situation resolved, but he pinged me about it a couple days later with the solution. The first is to make sure your service has the correct behavior to respond to any address:
[ServiceBehavior(AddressFilterMode = AddressFilterMode.Any)]
The next was to make sure you explicitly set the SecurityMode in the binding:
NetTcpBinding binding = new NetTcpBinding(SecurityMode.None);
Webroles are different as they are hosted in IIS and limited to HTTP.
Also, there are some good demos mentioned in this post on the MSDN forums that points to the Azure All-In-One demos on CodePlex.