I have packaged up multiple applications using the appHostConfig provider of MSDeploy enabling AppPoolExtension to include the app pool. I am now trying to parameterize the application pool identity for each application using the DocumentObjectAttribute
parameter type. I have been able to do this successfully with a package containing a single application with the associated app pool using the following parameter:
I am hung up on how to do this when there are multiple app pools in the package. When I use the same parameter just the first identity is changed and I need to be able to set each independently.
Try using a more complicated xpath match to limit yourself to the "right" application pool (you may also need to change your scope value). You can find free tools online to check your xpath matches (try searching "xpathvisualizer" for example) and get the
sample regex by doing a dump of your site (something like msdeploy -verb:dump -source:apphostconfig="mySite" -enableLink:apppoolextension -xml > c:\tempFile.txt). Here's also a good page for xpath examples:
http://msdn.microsoft.com/en-us/library/ms256086.aspx.
An xPath like this would target the userName attribute for processModel but only under appPoolConfig nodes with appPool="DefaultAppPool", so you can target the setting by application pool name:
The xpath query I am using is valid so it appears the scope value is the issue. I have tried using several values (application, appHostConfig, appPoolConfig.*, .*) for the scope using the data from the dump file but can only get the parameter to work if
I set the scope value to the element of the attribute I am trying to change (i.e. processModel in this case). My regular expression skills are lacking but I would expect to be able to use .* for the scope and then the appropriate xpath query to target the
attribute.
Below is the parameters file I have created. I have set the defaultValue of the userName attribute to a different value than what was set when the package was created so that I can easily test without the need of the setParameters.xml file.
Here is the msdeploy command I am using to deploy the package: msdeploy -verb:sync -source:package=package.zip,encryptPassword=**** -dest:auto,computername=comp1
I know the command is correct and the parameters files is valid because it works if I change the scope to processModel and match to processModel/@userName. Where I run into problems is targeting the correct userName attribute when the package contains multiple
application pools. I believe this is an issue with the scope value I am setting.
hendricksend
4 Posts
MSDeploy Parameter Scope
Jun 04, 2010 05:47 PM|LINK
I have packaged up multiple applications using the appHostConfig provider of MSDeploy enabling AppPoolExtension to include the app pool. I am now trying to parameterize the application pool identity for each application using the DocumentObjectAttribute parameter type. I have been able to do this successfully with a package containing a single application with the associated app pool using the following parameter:
<parameter defaultValue="testuser" name="UID">
<parameterentry type="DeploymentObjectAttribute" match="processModel/@userName" scope="processModel" />
</parameter>
...
I am hung up on how to do this when there are multiple app pools in the package. When I use the same parameter just the first identity is changed and I need to be able to set each independently.
krolson
350 Posts
Microsoft
Re: MSDeploy Parameter Scope
Jun 05, 2010 01:49 AM|LINK
Try using a more complicated xpath match to limit yourself to the "right" application pool (you may also need to change your scope value). You can find free tools online to check your xpath matches (try searching "xpathvisualizer" for example) and get the sample regex by doing a dump of your site (something like msdeploy -verb:dump -source:apphostconfig="mySite" -enableLink:apppoolextension -xml > c:\tempFile.txt). Here's also a good page for xpath examples: http://msdn.microsoft.com/en-us/library/ms256086.aspx.
An xPath like this would target the userName attribute for processModel but only under appPoolConfig nodes with appPool="DefaultAppPool", so you can target the setting by application pool name:
//appPoolConfig[@appPool="DefaultAppPool"]//processModel/@userName
hendricksend
4 Posts
Re: MSDeploy Parameter Scope
Jun 07, 2010 01:21 PM|LINK
The xpath query I am using is valid so it appears the scope value is the issue. I have tried using several values (application, appHostConfig, appPoolConfig.*, .*) for the scope using the data from the dump file but can only get the parameter to work if I set the scope value to the element of the attribute I am trying to change (i.e. processModel in this case). My regular expression skills are lacking but I would expect to be able to use .* for the scope and then the appropriate xpath query to target the attribute.
moshaikh
289 Posts
Microsoft
Re: MSDeploy Parameter Scope
Jun 07, 2010 04:48 PM|LINK
Can you give the exact command that you are using?
hendricksend
4 Posts
Re: MSDeploy Parameter Scope
Jun 07, 2010 05:41 PM|LINK
Below is the parameters file I have created. I have set the defaultValue of the userName attribute to a different value than what was set when the package was created so that I can easily test without the need of the setParameters.xml file.
<parameters>
<parameter name="UID" defaultValue="testUser">
<parameterEntry kind="DeploymentObjectAttribute" scope=".*" match="//appPoolConfig[@appPool="DefaultAppPool"]//processModel/@userName" />
</parameter>
</parameters>
Here is the msdeploy command I am using to deploy the package: msdeploy -verb:sync -source:package=package.zip,encryptPassword=**** -dest:auto,computername=comp1
I know the command is correct and the parameters files is valid because it works if I change the scope to processModel and match to processModel/@userName. Where I run into problems is targeting the correct userName attribute when the package contains multiple application pools. I believe this is an issue with the scope value I am setting.