Azure Web Application Gateway redirecting to Azure Web Application Services after Authentication

278 Views Asked by At

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.

1

There are 1 best solutions below

0
On

I created application gateway and web app with default domain and app gateway backend status are healthy and works like below:

enter image description here

In app service I enabled Azure Authentication and it redirected to the Web App URL:

enter image description here

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:

enter image description here

Change the Https only -> Off once you turn off, _Restart the app service and make sure to clear cache.

enter image description here

Now After authentication Application gateway is redirected successfully like below:

enter image description here