Extend Azure Mobile Service: add MVC and new routes
<p>I had my azure mobile service running for a bit, and now I want to add a website to it, so I can host both a website and backend service from one machine in the azure cloud. I have added MVC and all relevant scaffolding like controller, view, and registered a route. The problem I'm having is that the new route that I added "/Home/Index" somehow is getting rerouted to startup azure web service page<a href="https://i.stack.imgur.com/2KoDn.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2KoDn.jpg" alt="azure default startup page"></a></p>

<p>These are the parts in the code that I've added.
Controller:</p>

<pre><code>[RoutePrefix("Home")]
public class HomeController : Controller
{

    [Route("Index")]
    public ActionResult Index()
    {
        return View();
    }
}
</code></pre>

<p>View:
<a href="https://i.stack.imgur.com/XB0Qf.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XB0Qf.jpg" alt="mvc view"></a></p>

<p>Route:</p>

<pre><code>config.Routes.MapHttpRoute(
            name: "Default",
            routeTemplate: "{controller}/{action}/{id}",
            defaults: new { controller = "Home", action = "Index", id = RouteParameter.Optional }
        );
</code></pre>

<p>I feel like there is some mix up with the routes that are being added in the azure mobile service that is rerouting it to default page.</p>

<p><strong>UPDATE</strong>
After moving to mobile app service using the guide I had to move all config into Startup.cs:</p>

<pre><code>public class Startup
{
    public void Configuration(IAppBuilder app)
    {
        HttpConfiguration config = new HttpConfiguration();
        new MobileAppConfiguration()
            .AddTables(
            new MobileAppTableConfiguration()
                .MapTableControllers()
                .AddEntityFramework())
            .MapApiControllers()
            .AddPushNotifications()
            .ApplyTo(config);

        var builder = new ContainerBuilder();
        builder.RegisterApiControllers(Assembly.GetExecutingAssembly());
        var container = builder.Build();
        config.DependencyResolver = new AutofacWebApiDependencyResolver(container);
        DependencyResolver.SetResolver(new AutofacDependencyResolver(container));

        config.Routes.MapHttpRoute(
            name: "default",
            routeTemplate: "{controller}/{action}",
            defaults: new { controller = "Home", action = "Index" }
        );

        app.UseWebApi(config);
    }
}
</code></pre>

<p>So after doing all that I still see the default page and going to route "Home/Index" still shows this default page(showed above). I removed the <code>AddMobileAppHomeController()</code> but it didn't help.</p>