Restrict access to Azure Website by IP address

已答复 Restrict access to Azure Website by IP address

  • Tuesday, August 07, 2012 8:18 PM
     
     

    Hi, 

    I've currently got a site hosted in the "new" Azure, and I want to restrict access to specific IP addresses. I've found this resource, which talks about creating a startup.cmd file, and running it from ServiceDefinition.csdef.  

    Is this still relevant in the new Azure setup? If not, how can I restrict by IP?

    Thanks,

    Neil

All Replies

  • Tuesday, August 07, 2012 9:28 PM
     
     Proposed

    Hi,

    When you mention "new Azure setup" are you refering to the new Windows Azure Virtual Machines (IaaS offer) introduced in June? If so, you can apply IP restrictions on your Websites, in IIS.

    The resource you shared is about Windows Azure Cloud Services (Hosted Services - ie: WebRoles, WorkerRoles) (PaaS offer) and it is still a valid resource.

    Hope this helps!


    Cheers, Carlos Sardo

    • Proposed As Answer by Carlos Sardo Tuesday, August 07, 2012 10:21 PM
    •  
  • Wednesday, August 08, 2012 7:35 AM
     
     Proposed

    Hi Neil,

    You can check out a post that I recently wrote on IP filtering in windows azure in my blog
    http://shayyannay.wordpress.com/ you can find their step by step on how to implement it (IP restriction in IIS web server is valid for Iaas offering as well).




    Blogging on shayyannay.wordpress.com www.codeproject.com/Members/ShayYannay

    • Proposed As Answer by Shay Yannay Wednesday, August 08, 2012 7:35 AM
    •  
  • Wednesday, August 08, 2012 8:43 AM
     
     

    Apologies... I'm new to Azure, so I'm not sure of the correct terminology.

    I'm not using a VM. I went to the new "Preview" management portal, and added a new website. I then set up Git deployment and pushed my code directly to Azure. 

    

    There was no mention of any .csdef file.


  • Wednesday, August 08, 2012 8:59 AM
     
     

    Since you are running your web site under IIS try the following link on how to implement IP restriction:

    http://www.iis.net/ConfigReference/system.webServer/security/ipSecurity


    Blogging on shayyannay.wordpress.com www.codeproject.com/Members/ShayYannay

  • Wednesday, August 08, 2012 11:09 AM
     
     Answered

    Apologies... I'm new to Azure, so I'm not sure of the correct terminology.

    I'm not using a VM. I went to the new "Preview" management portal, and added a new website. I then set up Git deployment and pushed my code directly to Azure. 

    

    There was no mention of any .csdef file.


    since you're using a shared IIS (Azure Web Site) you want be able to configure any IP restrictions for that. If the website software which is running (blog, cms) supports this you may be able to do this at a software level, but you can't configure IP restrictions on machine or network level.

    If you need IP restriction or more control of your software in general you'll need to deploy the software in a web role or in a VM where you're able to control IIS the way mentioned by others in this thread.

    • Marked As Answer by AqueductDevs Wednesday, August 08, 2012 11:11 AM
    •  
  • Wednesday, August 08, 2012 11:12 AM