Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VSTS: Release Management Deploying Artifacts to IIS on Premise

I am using VSTS Release management to deploy artifacts to IIS websites. I have several Web applications and web services to be deployed. So, i am trying to figure out what sort of tasks that best fits my situation.

I have created a build definition with Visual Studio Build Task for projects as this one: enter image description here

which works fine but i need to add a task for copying the artifacts Under IIS Website Directory.

The other approach is to use IIS web deployment as a task in Release definition, so I created the build definition as:

enter image description here

However, it expects a Publish Profile (the build fails because it can't find it). I don't need to create a publish profile for each project in the application because this would be too much work.

Is there is a workaround for that or what is preferred approach for this?

like image 811
Hussein Salman Avatar asked May 12 '16 21:05

Hussein Salman


People also ask

Can Azure Devops deploy to on premise?

Now you can create a release from your build which is then able to be deployed to your on premise web server.

How do I publish a Visual Studio project to IIS?

Method one: Deployment to Folder --- for production We use the current version of Visual Studio 2019 16.9. 4, Right click the project you want to deploy, and choose publish.

How do I deploy to Azure Devops IIS?

Enable the Continuous deployment trigger, and add the main branch as a filter. Select Tasks, and then select IIS Deployment. Select the deployment group you created earlier from the dropdown menu. Select Save when you are done.

How do I deploy a ZIP file in IIS?

Select the project and click on properties. 3, Right-click on the project and select "Build Deployment Package". Visual Studio will build the deployment package (zip file) and will store it in the default location. If your IIS doesn't have this Deploy option then you need to install Extension of the IIS.


2 Answers

You can update your build definition to generate a web deployment package and upload it to artifacts. And then in Release Management, add a task to run "projectname.deploy.cmd" in the deployment package to deploy it to your IIS server. Refer to this link for details: How to: Install a Deployment Package Using the deploy.cmd File Created by Visual Studio.

And you can also enable FTP Publishing on your IIS server and add a task in your release to publish the artifacts via FTP. You may need this task: FTP Uploader.

like image 149
Eddie Chen - MSFT Avatar answered Nov 15 '22 07:11

Eddie Chen - MSFT


My Continuous Delivery with TFS / VSTS – Server Configuration and Application Deployment with Release Management blog post (with reference to some previous posts) has all the details you need for deploying your artefacts to target nodes using Windows Machine File Copy tasks then use PowerShell on Target Machines tasks to get them in to correct locations and to do token replacement and anything else that's required.

I would recommend using PowerShell DSC so that IIS is properly configured before deployment but that's not required. Where possible for web apps I favour keeping things very simple by creating artefacts that contain all the web files that are needed for a particular folder and then just using plain xcopy for the deployment.

like image 40
Graham Smith Avatar answered Nov 15 '22 07:11

Graham Smith