Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

Page not found error on Blazor WASM hosted on Azure Static Web App

$
0
0

I have a very basic Blazor WASM app targeting .NET 8 hosted on Azure Static Web Apps.

I just added a very simple page -- see below. I can just go direct to the URL locally and it works fine but on Azure Static Web App service, I get the following page not found error -- see below. What's interesting is that this is not the page not found error that my app should generate.

Here's the Azure page not found error:

enter image description here

My simple page looks like this:

@page "/privacy"<h3>Privacy Policy</h3><div><p>Some text about privacy policy</p><p>More text about privacy policy</p></div>

My app uses Azure AD B2C for user management and the privacy page I just added should be available to public i.e. anonymous users as well as authenticated users.

This is what my App.razor looks like:

<CascadingAuthenticationState><Router AppAssembly="@typeof(App).Assembly"><Found Context="routeData"><AuthorizeRouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)"><NotAuthorized>                    @if (context.User.Identity?.IsAuthenticated != true)                    {<RedirectToLogin />                    }                    else                    {<p role="alert">You are not authorized to access this resource.</p>                    }</NotAuthorized></AuthorizeRouteView><FocusOnNavigate RouteData="@routeData" Selector="h1" /></Found><NotFound><PageTitle>Not found</PageTitle><LayoutView Layout="@typeof(MainLayout)"><p role="alert">Sorry, there's nothing at this address.</p></LayoutView></NotFound></Router></CascadingAuthenticationState>

Any idea what could be the issue here?


Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>