I have tried IIS Manager and some online conversion tools but I can't figure out how to achieve the following .htaccess rules in a web.config file:
SetEnvIfNoCase Host my-domain.com nopassreq
AuthType Basic
AuthName "Restricted"
AuthUserFile "/home/my-domain.com/passwd"
require valid-user
Order allow, deny
Allow from env=nopassreq
Satisfy any
Basically if the user has come to the site using my-domain.com
it doesn't ask for authentication, but if it was my-other-domain.com
or anything else actually, it would ask for authentication.
I have multiple domains pointing to the same cloud instance on Azure, and I need some of those to require authentication and some not.