How can I have different Web.config files for different Azure slots.
I have a staging and production slot with the same website I don't want the staging slot to be public (it's only for testing and such), so I've setup authentication for that slot through the web.config file.
The problem is that when I upload changes the production slot gets the same web.config file as the staging slot which is set for only allowing access by authenticating, and also the parameters are different so the production slot ends up getting inaccessible, I have to change the web.config file manually in the production slot to make it work.
I wanted to have some way to define a different web.config file for the production slot.
Update (adding more information to the question):
I'm using my local machine for testing (with a local server), that is the development environment.
The sites are in wordpress (wordpress uses php).
The staging slot is used only by a few people, not connected to my local Lan, when I selectively want them to test my site (different Operating Systems, different platforms, different mobile phones,..) before sending things to production. I can just stop the staging slot, when I'm not using it so production resources are not be affected.
I'm already using AppSettings for different connectionStrings, and parameters. I don't know how to use this to define different authentication settings..? I have the authentication settings in the web.config file (used by the staging slot).
My web.config file:
<configuration>
<system.web>
<authorization>
<allow users="[email protected], [email protected], [email protected]"/>
<deny users="*"/>
</authorization>
</system.web>
<system.webServer>
<rewrite>
<rules>
<rule name="WordPress: http://contoso.azurewebsites.net" patternSyntax="Wildcard">
<match url="*"/>
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true"/>
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true"/>
</conditions>
<action type="Rewrite" url="index.php"/>
</rule>
</rules>
</rewrite>
</system.webServer>
<system.web>
<customErrors mode="Off"/>
</system.web>
</configuration>