Sivalingaamorthy
Sivalingaamorthy

Reputation: 1103

Azure App Service Returns Error - Error 403 - Forbidden The web app you have attempted to reach has blocked your access

I am getting error while accessing the Azure App Service, can you help in resolving the issue ?

What setting to be applied to resolve the issue ?

enter image description here

Thanks in advance.

Upvotes: 25

Views: 111685

Answers (4)

Kamalakar
Kamalakar

Reputation: 415

I found one reason that throw 403 forbidden error in azure webapp: 1.Go to azure portal 2.Go to Settings>Configurations in azure web app 3.Check Client certificate mode in General settings tab if it is Require ,then it throws 403 error .change it to ignore. Other reason may be TLS version setting is there in same tab .please check that also

Upvotes: 0

fakej Gazeta.pl
fakej Gazeta.pl

Reputation: 131

This error may also occur if you are in some (typically corporate) environment behind a proxy and you have configured your app service with VNet integration and private endpoint, so your app service has private address. In order to have it working you must have configured DNS records

_your_app_name_.azurewebsites.net _your_private_endpoint_ip
_your_app_name_.scm.azurewebsites.net _your_private_endpoint_ip

These DNS settings are obviously visible in your local network only but if your default proxy server is hosted in some DMZ and uses public DNS then you also need to tell your browser to bypass proxy server when accessing your app service to avoid accessing your app service using public interface. One possible way to do that is to configure no_proxy env variable:

export no_proxy="$no_proxy",_your_app_name_.azurewebsites.net,_your_app_name_.scm.azurewebsites.net

Upvotes: 1

KushalSeth
KushalSeth

Reputation: 4629

This error comes either

  • When the public access is not allowed on Azure App Service, if you have open public API.
  • The IP of your application with which you are calling the app service is not whitelisted.
  • If you have any gateway in between then that may also be blocking your calls.

Solutions to try:

  • Try removing the access restrictions from Networking page of your web app.

    enter image description here

  • Try giving the access to all by adding 0.0.0.0/0. Later you can add restrictions based on your requirements. enter image description here

  • The sequence of the restrictions matters, so please check that once. If you have any blocked call before any allowed call, then it may impact. enter image description here

  • You can also have restrictions based on http-headers like X-Forwarded-For. Please check that once. This can happen from code as well, based on how you handle the errors. Link

  • If your API is behind the Gateway, then you can check this: Application Gateway integration with service endpoints

Upvotes: 30

Doris Lv
Doris Lv

Reputation: 3398

Are you the developer of this website?

If you are, please navigate to Networking page of your web app, check the Access Restrictions. enter image description here If you are not the developer, just contact your administrator and allow your ip to access this website.

For more information, see Azure App Service access restrictions.

Upvotes: 5

Related Questions