Azure custom endpoint

466 views Asked by At

We are using more than one WCF RESTful application on Azure, one for users on Xbox 360 and one for users on PS3. The underlying architecture for both need to vary slightly so we are unable to combine the endpoints into one role.

Currently, both roles are under one Deployment on one Hosted Service. However, when accessing the roles, is it possible to have them sit at custom endpoints? Can that be extended to custom folders inside the endpoints?

Right now, I access the WCF REST app through http://[servicename].cloudapp.net/[template]

but i'd like to be able to separate them either as http://[servicename].cloudapp.net/[gamename]/ps3/[template] http://[servicename].cloudapp.net/[gamename]/360/[template]

where [gamename]/[env]/ would direct to a different role.

With the way it is setup now, all requests are going to my PS3 endpoint, even when the Xbox360 role is running with different services.

My question is can I do this by editing the ServiceDefinition.csdef or ServiceConfiguration.Cloud.cscfg file without changing the c# code of the service?

2

There are 2 answers

0
Grant H. On

I believe the short answer is no. You will need to edit the endpoint bindings in the web config or in code to facilitate those changes in the service behavior.

0
Tom On

When you have two roles in a deployment, in the ServiceDefinition.csdef file there should be an endpoint declared for each using a different port:

<InputEndpoint name="Endpoint1" protocol="http" port="8080" />

So you can access one using http://[servicename].cloudapp.net/ and the other using http://[servicename].cloudapp.net:8080/

Then you can use the WCF Routing Service to create the [gamename]/ps3/[template] routes for each of them and you should be good to go. But one will have to be on another port other then 80 for them both to listen to requests.