how to Configure Task for deployment asp.net project?

Mohi Rubel March 3, 2014

My project Build Successfully by MSBUILD and loaded build file in Shared Artifacts. now how to Canfigure Task for Deployment Download Build files from Artifacts and Transfer my server location and which one best for Asp.net Project like (MSDeploy) or others. please give me sample example.

1 answer

0 votes
Jason Monsorno
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 3, 2014

Assuming IIS, there are 3 components to take care of.

  1. Move the files
  2. Establish Application Pool
  3. Establish Web Application

For moving the files, I just use a network share and move stuff over using a filter to remove source code files*. The AppPool can be setup once and forgot in a lot of case but I prefer to keep all the setting in version control along with the application(s) using it; in our case almost every application has it's own AppPool so it is easy to manage. The WebApplication is telling IIS that have more than .html/images/css and typically want the Asp.netengine, you can also setup bindings there. So onto the how, I use powershell. Powershell scripts are added to the version control of the application and has some easy access to IIS control via the WebAdmistration module and since by AppPool only have one application I can easily deleted them and push new ones with the version controlled.

$appName = "YourApplicationName"
Import-Module WebAdministration
if (Test-Path "IIS:\AppPools\$appName")
{	Remove-WebAppPool $appName	}
if (Get-WebApplication -Name $appName)
{	Remove-WebApplication -Name $appName -Site "Default Web Site"	}
# Redacted copying files over

$appPool = New-WebAppPool $appName
# Redacted user information
$appPool.processModel.userName = $user
$appPool.processModel.password = $password
$appPool.processModel.identityType  = 3
$appPool.managedRuntimeVersion = "v4.0"
$appPool | Set-Item

New-WebApplication -Name $appName -Site "Default Web Site" -PhysicalPath "C:\inetpub\wwwroot\$appName" -ApplicationPool $appName

I removed our file copying to keep it pertinent and user information for obvious reasons but powershell can access some Marshall operations really easily and safely store passwords for you on the target machine(s).

*Wanted to show the script then explain, we move other everyone but source code so including the install script to the target machine in a temp folder then execute the install script locally on the target machine. We've been plagued with file copying issues and downtime latencies which were solved with that approach.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events