I have an Azure Application Gateway and and Azure Web Application, this web app uses the default domain (xxx.azurewebsites.net). The Application Gateway works fine with the Web App without Azure authentication (e.g. enter the public IP and web app loads on this public IP). But once I enable Azure Authentication, after the user authenticates they are redirected back to the Web App URL (xxx.azurewebsites.net) and not the Application Gateway Public IP address.
Is there a way I can make it redirect back to the Application Gateway Public IP address after authentication without needing to acquire a custom domain.
I created application gateway and web app with default domain and app gateway backend status are healthy and works like below:
In app service I enabled Azure Authentication and it redirected to the Web App URL:
Now to redirect back to the Application Gateway Public IP address in your app service go to configuration under setting then general setting like below:
Change the Https only ->
Off
once you turn off, _Restart the app service and make sure to clear cache.Now After authentication Application gateway is redirected successfully like below: