开发者

Does Azure support <ipsecurity/> in web.config?

开发者 https://www.devze.com 2023-01-05 16:35 出处:网络
In this post (as of January 10th) Allen Chen says it does not.However, it seems like the other poster indicates that it does (at least in the dev fabric).Does anyone know if this is s开发者_运维问答up

In this post (as of January 10th) Allen Chen says it does not. However, it seems like the other poster indicates that it does (at least in the dev fabric). Does anyone know if this is s开发者_运维问答upported.

My hope is to restrict access via IP address to my staging and dev sites. Adding this to the respective web.config's would be the easiest way.


You can get this working via a web role startup.cmd. Andy Cross has a great blog post explaining how http://blog.bareweb.eu/2011/04/restricting-access-by-ip-in-azure-web-role-v1-4/


I ended up just creating an httpmodule and filtered using that. I used Scott Hanselman's solution here as a starting point: http://www.hanselman.com/blog/AnIPAddressBlockingHttpModuleForASPNETIn9Minutes.aspx

It worked like a charm and provide a lot of flexibility. Thanks Scott.


I don't believe it is settable today in the webrole. Checking the applicationHost.config, I see that ipSecurity is set to disallow override, which means you cannot set it at the web.config level. That being said, if you take over the IIS process via Hosted Web Core (see code.msdn.microsoft.com/hwcworker), you can change the applicationHost.config and it might just work.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号