I am trying to host my rest based WCF service in the azure using a web role, I am using the following code snippet to create the host but getting the message FORBIDDEN 403: ACCESS IS DENIED. I am not able to figure out what is going wrong.
Is there possibility of any other issue which I may not be figuring out?
private void CreateServiceHost()
{
RoleInstanceEndpoint externalEndPoint = RoleEnvironment.CurrentRoleInstance.InstanceEndpoints["LeEndpoint"];
var baseaddress = String.Format("http://{0}:{1}",externalEndPoint.IPEndpoint.Address,externalEndPoint.IPEndpoint.Port);
var host = new ServiceHost(typeof(Service1), new Uri(baseaddress));
var binding = new WebHttpBinding();
host.AddServiceEndpoint(typeof(IService1),binding,baseaddress);
host.Open();
}