开发者

Set Application Pool for package using MSDeploy

开发者 https://www.devze.com 2023-01-22 13:44 出处:网络
I am deploying a website using MSDeploy so using something like the below code. \"%ProgramFiles%\\IIS\\Microsoft Web Deploy\\msdeploy.exe\"

I am deploying a website using MSDeploy so using something like the below code.

"%ProgramFiles%\IIS\Microsoft Web Deploy\msdeploy.exe" 
     -verb:sync
     -source:package=WebAppServer.zip 
    开发者_JS百科 -dest:Auto 
     -setParamFile="was_params.xml" 
     -verbose 
          >  webappserversync.log

Is there anyway to set the application pool ? I want to do this from the command line and not set it in a manifest or anything like that.

Shouldn't matter but this is in IIS7.


When you generate your package, you need to have an entry in the parameters.xml file for setting the Application Pool. When deploying, you either include a value for that in your setParameters.xml file, or use -setParam from the command line.

Here is the command I used to grab a site, which generated the proper parameters.xml file ...

msdeploy.exe 
  -verb:sync -source:appHostConfig="Default Web Site" 
  -enableLink:AppPoolExtension 
  -dest:package=site.zip 
  -declareParam:name="Application Pool",
       defaultValue="Default Web Site",
       description="Application pool for this site",
       kind=DeploymentObjectAttribute,
       scope=appHostConfig,
       match="application/@applicationPool"

And to install this site from the command line, this ...

msdeploy.exe 
    -verb:sync 
    -dest:appHostConfig="MagicSite" 
    -enableLink:AppPoolExtension 
    -source:package=site.zip 
    -setParam:"Application Pool"="MagicPool"

Dig around in the parameters.xml file to see the entry necessary. And if you prefer, that -setParam entry can exist in your params.xml file instead.


Take a look at this answer:

Set application pool with MSDeploy and TFS 2010

Basically, you create a batch file with an adsutil script to set the app pool, and then you call MSDeploy to run that batch file on the target computer.

0

精彩评论

暂无评论...
验证码 换一张
取 消