문제

I'm testing an application in the staging slot within a given web role. I don't want the staging application to be accessible to the public and I was wondering if there was anything I could add to the .cscfg file to lock down the application to just a set of known IPs? I had a look around the portal but couldn't see any way to restrict IPs there.

Any thoughts on this?

도움이 되었습니까?

해결책

You can enable the built in IIS IP and Domain Restrictions and then provide a list of IPs in your web.config (which sadly will mean a redeploy if you have to modify them). Here is a link to a blog post where someone did this: http://blog.liamcavanagh.com/2011/10/how-to-block-ip-addresses-in-windows-azure/

다른 팁

I never heard of it.

In your global.asax:

        protected void Session_Start()
        {
            if (Request.ServerVariables["REMOTE_ADDR"]!= "ÿour ip address here")
            {
                 Response.StatusCode = 404;
            }
        }
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top