Skip to content

.NET Application Remote Web Deploy automation II

September 20, 2011

As and addition to previous post here some notes that could help you.

MS SQL server command line deploy

Minimal command line parameters set for SQL 2008 R2 setup


Setup.exe /q /ACTION=Install /FEATURES=SQLEngine /INSTANCENAME=MSSQLSERVER /SQLSVCACCOUNT="<DomainName\UserName>" /SQLSVCPASSWORD="<StrongPassword>" /SQLSYSADMINACCOUNTS="<DomainName\UserName>" /AGTSVCACCOUNT="NT AUTHORITY\Network Service" /IACCEPTSQLSERVERLICENSETERMS

With Integration services features:


Setup.exe /q /ACTION=Install /FEATURES=SQLEngine,IS /INSTANCENAME=MSSQLSERVER /SQLSVCACCOUNT="<DomainName\UserName>" /SQLSVCPASSWORD="<StrongPassword>" /SQLSYSADMINACCOUNTS="<DomainName\UserName>" /AGTSVCACCOUNT="NT AUTHORITY\Network Service" /IACCEPTSQLSERVERLICENSETERMS /ISSVCACCOUNT="<DomainName\UserName>" /ISSVCPASSWORD="<StrongPassword>"

For log enabling use /INDICATEPROGRESS option

By default /ISSVCACCOUNT = “NT AUTHORITY\NETWORK SERVICE”

More about command line prompt options one can find on MSDN


MSDeploy command line parametrized web site deploy

Some times you need to change some parameters in configuration during deploy. So here is short process review:

First of all you need to create file parameters.xml  in root of your web project to declare parameters you want to change:


<?xml version="1.0" encoding="utf-8" ?>
<parameters >
<parameter name="ServiceAddress" description="Service Address" defaultValue="default value">
<parameterEntry kind="XmlFile" scope="\\web\.config$" match="//system.serviceModel/client/endpoint/@address" />
</parameter>
</parameters>

Here as an example we want to declare parameter ServiceAddress that can be found using  XPath  in match block for further change using  setParam command line option.

Add web.config endpoint part is looks like (all values can vary) in following block:

...
<client>
<endpoint address="http://localhost:8412/SampleService/MessageService"
binding="basicHttpBinding" bindingConfiguration="HttpBinding_IMessageService"
contract="SampleServiceReference.IMessageService" name="HttpBinding_IMessageService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
</client>
...

To launch deploy you should use command:

msdeploy.exe -verb:sync -source:package=<package path .zip> -dest:auto -allowUntrusted -setParam:name="ServiceAddress",value=<service address>

MSDeploy command line data base deploy

MsDeploy allows to deploy database using custom sql script. Here is presented minimum options set for making it:

 msdeploy.exe -verb:sync -source:dbFullSql=<absolute path to .sql script> -dest:dbFullSql="Data Source=<Data Source>;User Id=<user id>; password=<password>",transacted=false
 

Useful links:

Declare and set params on technet.microsoft.com

The MSDeploy SQL Database Provider (dbFullSql)

Web Deploy Parameterization in Action

How to: Install SQL Server 2008 R2 from the Command Prompt

Advertisements

From → Automation

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: