hosted wcf service accessing external service

89 views Asked by At

I have a wcf service named "ServiceA" which is been hosted in azure cloud service . Now, I have one more service which can be accessed only within a private network.

Is it possible to make "ServiceA" consume "ServiceB" which is present in private network by adding the network ip address anywhere in the configuration?.

3

There are 3 answers

0
Shirish On

Try this solution by IP Restriction, So you can allow Known IP and you can stop other IP.

https://www.stokia.com/support/misc/web-config-ip-address-restriction.aspx

0
Mahesh Jasti On

Yes you can do that using Azure ServiceBus Relay. Using service bus relay, start exposing your private service through an outbound port and all the parties that need to reach your private service (service B) can come to ServiceBus Relay which in turn knows how to reach your private service. Have a look over Azure ServiceBus Relay.

But you may end up having a piece of code that exposes your private service over the relay, which is a very small one.

Ref - https://azure.microsoft.com/en-in/documentation/articles/service-bus-dotnet-how-to-use-relay/

0
MattC On

You could expose a duplex contract on a NetTcp endpoint on ServiceA and have ServiceB initiate a connection to ServiceA. ServiceA can then use the callback contract to make calls into ServiceB.