Azure app service deep link 404 error

Hi,

After deploy an Angular Radzen app .net core 3.1, I noted that urls others that root doesn't work returning a 404 error. Googling about, people say that we need redirect to root considering that Angular router will resolve url internally. I saw two kinds of solutions:

1 - Adding to web.config:

<httpErrors errorMode="Custom" existingResponse="Replace">
            <remove statusCode="404"/>
            <error statusCode="404" responseMode="ExecuteURL" path="/index.html"/>
        </httpErrors>

2 - Adding code to Startup:

// Startup.Custom.cs
partial void OnConfigure(IApplicationBuilder app)
{
app.Use(async (context, next) =>
{
await next.Invoke();
if (context.Response.StatusCode == 404 && !context.Request.Path.Value.Contains("/api"))
{
context.Request.Path = new PathString("/");
await next.Invoke();
}
});
}

I tried both and doesn't work.

Modifying web.config result in

The page cannot be displayed because an internal server error has occurred.

Adding code to startup.cs result in

HTTP Error 500.31 - ANCM Failed to Find Native Dependencies

Common solutions to this issue:

The specified version of Microsoft.NetCore.App or Microsoft.AspNetCore.App was not found.

Any ideas?

Thanks in advance,

If you use Radzen's deploy feature it should generate Startup file with everything required. How did you deploy your application?

I'm using deploy to zip because azure deploy option is failing. All seems ok but files are not updated.

image

After this, I looked folder content with ftp client and files was not replaced.

Radzen generates the redirect code in all deployment scenarios. What exactly doesn't work in your application? Can you provide a live URL to test? Does it work locally?

URL is https://covid-azure-cmp.azurewebsites.net/

When you access this URL app redirect to /encuesta page (Start page of app). But if you hit address bar to reload or use https://covid-azure-cmp.azurewebsites.net/encuesta throw an error.

Locally app is working fine. I deployed to Ubuntu (Nginx) and is working fine too. Problem is with app service in Azure.

If it works locally and on Ubuntu then the problem is something Azure specific. Not sure what is causing it.

For some reason I can't load https://covid-azure-cmp.azurewebsites.net/ though. After a while it returns the following error message:

Just remembered something. When deploying to Azure manually make sure you are not copying just the wwwroot directory of the Radzen application. You need to deploy everything.

I rebooted app service. Must be load now.

When I tried .../encuesta:

image

I am now getting this error:

Make sure your Azure instance has .NET Core 3.1 installed. Radzen cannot verify that from the deploy screen.

I deleted the app service and recreated. Later I used Radzen to deploy to azure and now is working fine, deep link is working. I don't know was wrong with app service but start again result fine.
Thanks for your dedicated support!

There is a chance you created the app with a different .NET Core versions hence the problems. Maybe 2.2 when it needs 3.1.