Parameterization improvements in Web Deploy V3

by Harsh Mittal

Earlier versions of Web Deploy only supported replacing attribute values which already existed as part of the package. In Web Deploy V3 we have added support to:

  1. Extend the current xml parameterization beyond attribute value replacements to a more complete xml modification story by allowing addition/deletion/replacement of new elements.

  2. Accept the replacement data for parameters to come from the server, from the package itself or from the source. Here is one example of a parameters.xml file which will add newNode to all nodes including the root in the target xml file:

    <parameters><parameter name="Additive" description="Add a node" defaultValue="&lt;newNode />" tags=""><parameterEntry kind="XmlFile" scope=".*" match="//*" /></parameter></parameters>

Below are some examples which demonstrate how to get the values from other places.

Get values from the remote server:

<parameter name="Replacement Param" defaultValue="\\myshare\share\web.config:://connectionStrings" >"<parameterEntry kind="XMLFILE" scope="web\.config$" match="//connectionStrings" /></parameter>

Get values from a file in the package that is being synced:

<parameter name="Replacement Param" defaultValue="\web.config:://connectionStrings" >"<parameterEntry kind="XMLFILE" scope="web\.config$" match="//connectionStrings" /></parameter>