Release Automation

Expand all | Collapse all

How to  include space in Element List parameter(-setParam:"IIS Web Application Name"="ABC")?

Jump to Best Answer
  • 1.  How to  include space in Element List parameter(-setParam:"IIS Web Application Name"="ABC")?

    Posted 03-05-2018 09:43 AM


    I am trying to write an action for the below msdeploy.exe

     

    "C:\Program Files (x86)\IIS\Microsoft Web Deploy V3\msdeploy.exe" -source:package='ABC.Web\obj\%configuration%\Package\ABC.Web.zip' -dest:auto,computerName='%LocalMachineName%',includeAcls='False' -verb:sync -disableLink:AppPoolExtension -disableLink:ContentExtension -disableLink:CertificateExtension -setParam:"IIS Web Application Name"="ABC"

     

     

    I tried some of the probabilities using "(quotation)and '(single quote) it did not work.

     

    "(quotation) gives below Error(-setParam:"IIS Web Application Name"="ABC"):
    Error: Unrecognized argument '"-setParam:"IIS'. All arguments must begin with "-".

     

    Kindly help how to setup -setParam parameter?

     



  • 2.  Re: How to  include space in Element List parameter(-setParam:"IIS Web Application Name"="ABC")?

    Broadcom Employee
    Posted 03-05-2018 10:18 AM

    Hi Mohanraj,

     

    In this stack overflow question/answer it looks like they use:

    -setParam:name="IIS Web Application Name",value="site name"

    Stack Overflow Question/Answer:

    webdeploy - How to set destination website on MSDeploy.exe command line - Stack Overflow 

     

    I did read it a little and it seems like that answer may not have solved the problem for many. But there is another answer that seems by Scott that seems to have worked for several people. It seems like the second answer is describing how to do the same thing in powershell.  

     

    Does this help?

     

    Kind regards,

    Gregg



  • 3.  Re: How to  include space in Element List parameter(-setParam:"IIS Web Application Name"="ABC")?
    Best Answer

    Posted 03-05-2018 11:25 AM

    We take a slightly different approach to deploying with MSDeploy:

     

    The output of the build creates a folder structure that includes:

     - The zipped application files

     - A .cmd file for deployment

     - a SetParameters.xml file

     

    It is the SetParameters file that really helps us out here.  It looks like this:

    <?xml version="1.0" encoding="utf-8"?>
    <parameters>
    <setParameter name="IIS Web Application Name" value="Default Web Site/blah-blah-sitename" />
    </parameters>

     

    In CARA. we have an action of type "Run Command Line" which simply runs this .cmd file with the "/Y" switch.  (e.g. MySite.deploy.cmd /Y).  This manages the intricacies of calling MSDeploy for us.

     

    If you're wondering how this all gets created, in Jenkins we have a build job that uses MSBuild.  It is run against the .Net web app project file from Visual Studio.  Params for MSBuild look like:

    /fl /v:diag /p:Configuration=Release /p:Platform="Any CPU" /p:OutputPath=${WORKSPACE}\Internal\BuildArtifacts /p:VisualStudioVersion=14.0 /p:DeployOnBuild=true /p:DeployTarget=Package /p:AutoParameterizationWebConfigConnectionStrings=false /p:DeployIISAppPath="Default Web Site/blah-blah-sitename" /p:PackageLocation=${WORKSPACE}\BuildArtifacts\_PublishedWebsites\MyWebApp_Package\MyWebApp.zip

     

    You'll notice that the IIS Site Name is specified here, which in turn passes through to the SetParameters.xml file.  

     

    Hope this helps...



  • 4.  Re: How to  include space in Element List parameter(-setParam:"IIS Web Application Name"="ABC")?

    Posted 03-06-2018 12:15 AM

    The below Action worked  for my solution.