I’m currently looking into developing an azure hosted web service to act as a proxy between my mobile app and a third party web service in order to keep my API secret. I haven’t a great deal if experience with azure architecture and was wondering if someone might be able to provide some guidance.
Thinking about this problem my first thought would be to host an asp.net web API on azure, send the data from the phone to the azure API acting as a proxy which would receive the web request, then forward the info. With the API secret to the web service via another httpwebrequest and then returning that response as the original API call response.
Firstly, would this work? And secondly, if I was to have one web role performing this task would it only be able to field one request at a time, having to wait for one request to return from the third party before sending of a request from another phone? This could prove to be a problem if the call to the third party takes a second or so I guess in terms of scalability.
Any other architecture suggestions as to how I can do this would be greatly appreciated!
As far as I know ASP.NET Web API is not yet supported on Azure (YET), Windows Azure only runs .NET 4 runtime, there are ways around this to run MVC 4 on Azure but its not officially supported yet.
You can certainly have a proxy service that intercepts your request and then relays it on, the architecture does sound a little convoluted but you might/must have valid reason for it. I would try an embrace HTTP (REST) for all communication from your clients for maximum interop and also to reduce latency.
Your second question is about scaling out, you should never run one instance of your Web Role as this does not meet the Azure SLA (2 minimum). You should also always strive for asynch programming/design when you are looking to build internet scalable apps. If you build a stateless WCF Service then you can horizontally scale to cater for more traffic. If you have global reach from your consumers you could also use Windows Azure Traffic Manager across geolocated instances of your service http://msdn.microsoft.com/en-us/gg197529
HTH