0

I'm trying to deploy a web application from Visual Studio Team Services Build. I'm using Visual Studio Build task to build the project. Then, use command line task to execute generated release.deploy.cmd to deploy in IIS server. On executing, I faced the below issue:

E"C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe" -source:package='C:\CIDeploy\webapp.zip' -dest:auto,includeAcls="False" -verb:sync -disableLink:AppPoolExtension -disableLink:ContentExtension -disableLink:CertificateExtension -setParamFile:"C:\CIDeploy\webapp.SetParameters.xml"

2016-12-02T10:29:18.2576272Z Warning: BACKUP_FAILED - Skipping backup because it failed due to an unknown reason. For more information, contact your server administrator. 2016-12-02T10:29:18.2586324Z Skipping backup because it failed due to the following error 'System.UnauthorizedAccessException: Filename: redirection.config

Error: An error occurred when reading the IIS Configuration File 'MACHINE/REDIRECTION'. The identity performing the operation was 'TASKAGENT5-0017\buildguest'.

2016-12-02T10:29:18.4396280Z Error: Filename: \?\C:\Windows\system32\inetsrv\config\redirection.config 2016-12-02T10:29:18.4396280Z Error: Cannot read configuration file due to insufficient permissions

Thanks in advance.

9
  • are you running as administrator? Commented Dec 2, 2016 at 11:12
  • yes,I have logged in as administrator user account into my computer. Commented Dec 2, 2016 at 11:14
  • @Krishnajoshi What's the result if you are using WinRM-IIS Web App Deployment task/step to deploy your project? Commented Dec 8, 2016 at 2:15
  • @starain-MSFT I am also new to this but according to documentation this step will create a website into IIS server running on target server by connecting through WinRm service. I am facing the following issue *when using HTTPS Verify that the specified computer name is valid, that the computer is accessible over the network, and that a firewall exception for the WinRM service is enabled and allows access from this computer. When using HTTP Access is denied. Commented Dec 8, 2016 at 5:57
  • @Krishnajoshi Do you mean you want to deploy app by using HTTP protocol? Commented Dec 8, 2016 at 6:23

2 Answers 2

2

Using WinRM-IIS Web App Deployment task/step to deploy your web project.

  1. Install IIS Web App Deployment Using WinRM extension
  2. Add WinRM-IIS Web App Management step/task to your build/release definition
  3. 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:

  1. Download or create ConfigureWinRM.ps1 file (source code)
  2. Go to target server (IIS)
  3. Start Windows PowerShell as Administrator
  4. Go to (CD command) the path that contains ConfigureWinRM.ps1 file
  5. Run .\ConfigureWinRM.ps1 [machine name with domain] https
  6. Open Microsoft Management Console (MMC) (Type mmc in Run command (win+R))
  7. File=>Add/Remove Snap-in=>Select Certificates=>Add=>Ok
  8. Expand Certificate (Local Computer)=>Personal=>Certificates
  9. Select the certificate file according to the Issued to (step 5)
  10. Right click it=>All task=>Export to export certificate file
  11. Copy exported file to your build server
  12. Double click that file=>Install Certificate=>Local Machine=>Place all certificates in following store=>Trusted Root Certification Authorities
  13. Add Visual Studio Build step/task (MSBuild argument: /p:SkipInvalidConfigurations=true /p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageLocation="$(build.artifactstagingdirectory)\WebGeneralDemo.zip") enter image description here
  14. Add Windows Machine File Copy step/task enter image description here
  15. Add WinRM- IIS Web App Management step/task enter image description here
  16. Add WinRM-IIS Web App Deployment step/task enter image description here

BTW: you can put deploy task in release (refer to that article)

Sign up to request clarification or add additional context in comments.

Comments

0

You cannot deploy locally on a Hosted Agent: you must deploy to another machine. The easiest way is to use VSTS Resource Management and and Agent running on the target machine with administrative privileges (I would suggest to run it non-admin and grant in IIS permission to the user to deploy).

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.