0
votes

Hello i have a Java Servlet(Jersey2 + Jax-rs)Api App deployed by Azure portal not from marketplace.

So now i am trying to configure my server or container to restrict IPs and HTTP requests, However, from azure guidelines in the websites are talking about setting web.config file to do that right?

but there is no web.config file in my directories.

does it mean that i need and can make a web.config file by myself and ftp to wwwroot folder?

or just as usual, put servlet filter into my app?

1
Correct, you will need to create a new web.config file from scratch. You won't need to FTP it though, you can use Kudu to upload the file or include it in your Web Deploy publish step.Dai
meaning that my container(tomcat) is running on the IIS? that is why i need and can configure my web server with web.config file? web.config is for .net web app not for java.Myoungso Kang
and plus wanna make sure that the right position of web.config is "site/wwwroot" folder?Myoungso Kang
and then what is difference between configuring at web.config and in servlet filter?Myoungso Kang
web.config is not meant for .NET web app, it is meant to configure IIS web server. Yes, site/wwwroot is the right location.Abhay Saraf

1 Answers

1
votes

@MyoungsoKang, there are many ways to restrict IPs or HTTP requests for Azure App Services, please see below.

  1. Configuring web.config for IIS on Azure which you can create in the wwwroot by yourself like the answer for the SO thread Azure website IP restriction.
  2. Using filter for Java servlet container to flexibly control the inbound requests.
  3. Adding Web Application Firewall ModSecurity on Azure website, please see the blog and refer to the reference manual to know how to use it.