2

I'm new in Microsoft Azure and we are encountering problem in limiting access in specific page of our website to specific ip address. What we would like to do is only specific ip address can visit certain pages like /user, /admin. We don't know if there's a way in allowing specific ip using Web.Config.

I hope you can help me. Thank you

Anass Kartit
  • 2,017
  • 15
  • 22
LordGrim
  • 731
  • 2
  • 11
  • 22
  • 1
    This is an ASP.NET MVC application? How do you host it? in azure Web Apps? or in some container or on a VM? – hujtomi Jan 31 '19 at 21:41
  • We're using Drupal as a Service. We are using module for it but it is not working properly so what we want to try is to redirect all unallowed ip address in visiting some pages. – LordGrim Feb 01 '19 at 04:52
  • I think in this case you host it in an Azure App Service, you should check: https://learn.microsoft.com/en-us/azure/app-service/app-service-ip-restrictions – hujtomi Feb 01 '19 at 09:05

2 Answers2

1

I think you need to look at Application Gateway to restricte IP to a specific route.

https://learn.microsoft.com/en-us/azure/application-gateway/tutorial-restrict-web-traffic-powershell

Anass Kartit
  • 2,017
  • 15
  • 22
1

It is possible to do it in the web config: https://learn.microsoft.com/en-us/iis/configuration/system.webserver/security/ipsecurity/

Example: Is it possible to configure a location in Web.config to only allow local connections

If you want to allow specific IP address on a specific route, then you can create a custom IP filter attribute like this, and you can put it on your controllers: Restrict access to a specific controller by IP address in ASP.NET MVC Beta

hujtomi
  • 1,540
  • 2
  • 17
  • 23