Hi everyone
Could you please help me with this issue?
In Azure portal there is a service for the deployment slot
- the main application is the web production slot production
- the secondary is a C# core 5.0 application always redirecting to the index page (offline application)
in the the secondary application the Startup.cs file I set up the error handle 404 as follows
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
else
{
app.UseExceptionHandler("/Error");
app.UseHsts();
}
app.UseHttpsRedirection();
app.UseStaticFiles();
// Here is our middleware registration for error status code handling
app.UseStatusCodePagesWithReExecute("/Index");
app.UseRouting();
app.UseAuthorization();
app.UseEndpoints(endpoints =>
{
endpoints.MapRazorPages();
});
}
in the main application error handle I set up in the web config file as:
<customErrors mode="On" defaultRedirect="/Error" >
<error statusCode="404" redirect="/Error/NotFound"/> <!--not found -->
</customErrors>
-Issue comes if the user is navigating on the main page after changing the traffic in the slot main to 0 percent and secondary slot to 100 percent:
if the user is on the main page performing a process Request POST (e.g. click submit button) user is not being redirected to the secondary slot (offline page)
- however, there is no issue if a user is navigating from one page to another in the main application like request GET (url) user is being redirected to the secondary slot page
thanks in advance for your advice on how to get a solution for it