Search code examples
iis-7.5web-deploymentwebdeploypublish-profiles

Web Deployment Publish parameters.xml to match windows authentication providers


I have a Web Deployment publish profile in my visual studio project. I have multiple environments, which in one I use NTLM provider and on the other I user Negotiate:Kerberos provider on the windows authentication mode.

My question is: How can I set the parameters.xml "match" value in order to set the right provider when using msdeploy.

The provider tag is as follows:

<add value="NTLM" />

Or instead:

<add value="Negotiate:Kerberos" />

Is it even possible to pull this of via parameters.xml only? If not what is the right way of doing so?


Solution

  • Found a workaround.

    At the parameters.xml I created a <parameter> element with the following:

    <parameterEntry kind="XmlFile" scope="\\web\.config$" match="/configuration/system.webServer/security/authentication/windowsAuthentication/providers/add/@value" />
    

    This parameterEntry will match the providers.

    Afterwards, at the deploy time, the value that will be replacing the matched value in the parameterEntry will be: Negotiate:Kerberos.

    In this way, I managed to replace the values. Currently it's kind of problematic to place multiple providers, but I think it can be accomplished with matchers and the parameters.xml by changing it a little bit.