Does Azure WebApp support forms authentication with nested applications?

Gareth Barnes 1 Reputation point
2020-02-25T16:21:45.593+00:00

I'm testing migration of a system to Azure Web Apps from on-premise IIS. The system comprises two .Net Web Forms applications with one of them nested under the other and accessible via [baseurl]/admin. The nested application uses Forms authentication. I've used the configuration section of the main Web App in the Azure portal to add a Path mapping for /admin as an Application and have uploaded all the required code into the specified folder.

When I access the default login page under /admin I can enter my username and password as expected but when I do so although the url in the address bar changes to show the returnURL(defaultURL) specified in the web.config. I've managed to establish that the custom code I've written has successfully verified the username and password but when the FormsAuthentication.RedirectFromLoginPage method is called the next page does not find an authentication cookie. Running the exact same code as a stand alone Web App works fine so it seems to be a problem with the nesting of the application. Does anyone have an idea of why the nested application can't read the authentication cookie?

If I remove the web.config deny anonymous users restriction on the page that is being redirected to after login to allow access for all users the page displays the correct name for the logged in user so authentication has worked but for some reason it doesn't satisfy forms authentication.

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
6,876 questions
{count} votes