Using WinRM-IIS Web App Deployment task/step to deploy your web project.
- Install IIS Web App Deployment Using WinRM extension
- Add WinRM-IIS Web App Management step/task to your build/release definition
- Specify necessary arguments (e.g. Admin Login, Password)
On the other hand, there are others extension in marketplace that can deploy web project.
Update:
Detail steps:
- Download or create ConfigureWinRM.ps1 file (source code)
- Go to target server (IIS)
- Start Windows PowerShell as Administrator
- Go to (CD command) the path that contains ConfigureWinRM.ps1 file
- Run .\ConfigureWinRM.ps1 [machine name with domain] https
- Open Microsoft Management Console (MMC) (Type mmc in Run command (win+R))
- File=>Add/Remove Snap-in=>Select Certificates=>Add=>Ok
- Expand Certificate (Local Computer)=>Personal=>Certificates
- Select the certificate file according to the Issued to (step 5)
- Right click it=>All task=>Export to export certificate file
- Copy exported file to your build server
- Double click that file=>Install Certificate=>Local Machine=>Place all certificates in following store=>Trusted Root Certification Authorities
- Add Visual Studio Build step/task (MSBuild argument: /p:SkipInvalidConfigurations=true /p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageLocation="$(build.artifactstagingdirectory)\WebGeneralDemo.zip")
- Add Windows Machine File Copy step/task
- Add WinRM- IIS Web App Management step/task
- Add WinRM-IIS Web App Deployment step/task
BTW: you can put deploy task in release (refer to that article)