Table of Contents

IT:AD:WebDeploy:HowTo:Create a Publish Profile/Parameters.xml

Summary

WebDeploy Publish Profiles (and their accompanying IT:AD:XDT transformation) can be used to deploy known/fixed settings based on Build Configuration (Debug, Release), such as Debug=true|false, or ConnectionString CatalogName="MyAppDevSS"|"MyApp".

But it's not appropriate for everything: * Security Leakage: using WCT to keep ST, QAT, and PROD environment settings in a file that is source controlled, available to all developers, is not secure. * It doesn't take into account target Environments – beyond Configuration – such as ST, UAT, PROD, or web farms, or Azure – where the same software is deployed to different servers requiring different slightly configurations.

Parameters are useful when:

  • you have to create a package without knowing some of the values that will be needed when the package is installed.

Parameters are used to drive * the command line .cmd that Visual Studio the IIS import mechanism (which has the advantage of providing a means for the installer to override the values as needed).

  • note that in an enterprise environment, if a decent Parameters.xml file was generated for the target environment, there should be little to no need for end user overrides.

Process

Location

When you Create a Publish Profile you are creating an IT:AD:MSBuild Project file, that by convention will be looking to see if you have created an accompanying Parameters.xml file.

By default, Visual Studio will have not made the Parameters.xml file for you – it's up to you to Add a New Item...Xml File to the root of the Project:

Settings

Parameters.xml File Syntax

For each transformation, you'll be defining a parameter element, with a nested parameterEntry:

<?xml version="1.0" encoding="utf-8" ?> 

<parameters>

   <parameter name="DataBaseUserName"
      description="Database username"
      defaultValue="MySQLDatabaseUser"
      tags="MySQLParam"
      <parameterEntry
         kind="TextFilePosition"
         scope="application\\settings.php"
         match="92;21;11" />
      </parameter>

</parameters>

Parameter Elements and Attributes

The element names and attributes are: