MapControllerRoute 404 in Azure Production not in ...
# help-with-umbraco
k
We are using this good old approach since v10ish to inject normal ASP.NET endpoints, e.g., for `sitemap.xml`:
Copy code
builder.Services.Configure<UmbracoPipelineOptions>(options =>
  options.AddFilter(new UmbracoPipelineFilter(nameof(SitemapController))
    Endpoints = app => app.UseEndpoints(endpoints =>
      endpoints.MapControllerRoute(..., "sitemap.xml", ...
This works fine in development in v15, but in Azure with runtime mode Production we get straight up 404s for all these endpoints. The same thing works fine in v13 and below. We have employed the
HandleAsServerSideRequest
trick to get an Umbraco context since v13.4. https://github.com/umbraco/Umbraco-CMS/issues/16969#issuecomment-2464641406 Anyone know why this could be, or how I can debug it? The code above runs in a regular
IComposer
. Could it have to do with the 404 behavior itself somehow? For some reason we get empty ASP.NET 404s in the test environment, but Umbraco "Page not found"s in production. Hmm.
3 Views