restrict access to staging and dev slots restrict access to staging and dev slots azure azure

restrict access to staging and dev slots


The default is to match all conditions, but you need to match only one, since it is either the dev or staging site. You need to add logicalGrouping="MatchAny", also you need to add http:// to www.google.fr. Below rule should work:

<rule name="Block unauthorized IP to staging/dev sites" stopProcessing="true">      <match url=".*" />      <conditions logicalGrouping="MatchAny">        <add input="{HTTP_HOST}" pattern="myapp\-dev.azurewebsites.net" />        <add input="{HTTP_HOST}" pattern="myapp\-staging.azurewebsites.net" />        <!-- Enter your staging site host name here as the pattern-->        <!-- Add the white listed IP addresses with a new condition as seen below -->        <!-- <add input="{REMOTE_ADDR}" pattern="123\.123\.123\.2" negate="true"/> -->      </conditions>      <action type="Redirect" redirectType="Permanent" url="http://www.google.fr" /></rule>