How To Password Protect a Static Site in Azure
You could use Forms Authentication which should be pretty straightforward to implement and won't require any startup task (necessary to run appcmd.exe).
Set your application to use forms authentication in your web.config.
<authentication mode="Forms"> <forms name=".ASPXAUTH" loginUrl="/myadminlogin.aspx" protection="All" path="/" timeout="120" /></authentication>
Define the protected folders in your web.config.
<location path="secure"> <system.web> <authorization> <deny users="?" /> </authorization> </system.web> </location>
Within your login area check a condition and set the auth cookie:
'SET AUTH COOKIE FormsAuthentication.SetAuthCookie(sessionID, False) response.redirect(/secure/securearea.html)
This unfortunately is the one page where you will need some server side code.