Make WebAPI internal to Azure

I need to make web api internal to Azure cloud. What attributes or settings should I make?

Setting up

  • I have two applications deployed in an azure cloud.
    1st is an MVC5 frontend with a UI. The second is WebAPI.

  • A user external to the cloud can only make calls to the 1st application. The first application invokes the second possession within the cloud.

  • I am not making users external to the cloud make calls to the second application.

How can I limit it?

The first application is a web site deployed in the cloud. The second app is also an MVC5 website using only WebAPI deployed in the cloud.

Thanks in advance.

+3


source to share


1 answer


Since Azure websites do not yet support virtual networking, you can configure IP address limiting.

Place this section in your Web.config file and replace the IP address with the MVC5 address.



<security>
  <ipSecurity allowUnlisted="false">    <!-- block everybody, except those listed below -->     
    <add ipAddress="999.999.999.999" allowed="true"/>    <!-- allow requests from the MVC5 app -->
  </ipSecurity>
</security>

      

One caveat is that all websites from the same Azure region use the same IP address. To get around this you need to set up SSL as described here: http://blogs.msdn.com/b/benjaminperkins/archive/2014/05/05/how-to-get-a-static-ip-address-for -your-microsoft-azure-web-site.aspx

+1


source







All Articles