how to Configure Task for deployment asp.net project?

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

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
Community showcase
Posted Tuesday in Featured Groups

Tuesday tips & tricks: What is the Atlassian Community?

It's officially Tuesday, which means it's officially time for another tip to help you better navigate this space we call the Atlassian Community. 😄 I got a great question from community member, Sa...

132 views 6 8
View post

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you