Skip to main content

4 - IIS Workflows and Pipelines

Once you have the Harness Services for IIS website, application, and virtual directory, and the Harness Environment for your target infrastructure, you create Harness Workflows to deploy the IIS website, application, and virtual directory Services.

In this topic we walk through create a Workflow for the IIS website Service, but the Workflows for IIS application and virtual directory Services follow the same steps:

Before deploying the IIS website, application, or virtual directory to your Windows instances, there must be an existing IIS Web Server Role on the instance. This ensures that the environment is ready for deployment. Harness IIS Website deployment requires the IIS Web Server Role. The Harness IIS Application and IIS Virtual Directory deployments require that an IIS Website exists. For more information, see Installing IIS from the Command Line below.

Create an IIS Website Workflow

Workflows are the deployment steps for services and environments, including types such as Canary and Blue/Green. Workflows also include verification, rollback, and notification steps.

  1. In your application, click Workflows.
  2. Click Add Workflow. The Workflow dialog appears.

The dialog has the following fields.

FieldDescription
NameGive your Workflow a name and description that tells users what it is deploying.
Workflow TypeIn this guide, we will do a simple Basic workflow. For a summary of workflow types, see Add a Workflow.
EnvironmentSelect the environment you added.
ServiceSelect your IIS Website service.
Infrastructure DefinitionSelect the Infrastructure Definition you added.

When you are finished, click SUBMIT. The workflow is generated:

  1. Under Prepare Infra, click Select Nodes. The Node Select dialog appears.

If you deploy in multiple phases, you can control what hosts to use for each phase. If you are simply doing one phase, you do not need to select hosts.
The Node Select dialog has the following fields.

FieldDescription
Select Specific hosts?Select Yes to enter the hostname(s) of the nodes where you want the website deployed.Select No to have Harness select the host(s) in the Infrastructure Definition based on the setup the in Environment. For AWS deployments, Tags are often used to help Harness select hosts.
Desired InstancesEnter the number of instances you want deployed.You can also enter a variable expression in this setting, such as a Workflow variable:This turns the setting into a deployment parameter. When the Workflow is deployed (manually or by Trigger) you can provide a value for the parameter.See Set Workflow Variables and Variables and Expressions in Harness.
Instance Unit TypeIdentify if the number in Instances is a count or percentage.For example, if you select 10 in Instances, you can select Count and the artifact is deployed to 10 instances. Or you can enter 100 in Instances and select Percent and the artifact is deployed to 100% of the instances in the Infrastructure Definition.

When you're finished, click SUBMIT.

  1. Under Deploy Service, click Install. The Install dialog appears. You can set how long the installation may take before it's timed out. The default is 60000ms or 10 minutes. When you are finished, click SUBMIT.

Now that your workflow is complete, you are ready to deploy.

Deploy IIS Website

Before deploying the IIS website, application, or virtual directory to your Windows instances, there must be an existing IIS Web Server Role on the instance. This ensures that the environment is ready for deployment. Harness IIS Website deployment requires the IIS Web Server Role. The Harness IIS Application and IIS Virtual Directory deployments require that an IIS Website exists. For more information, see Installing IIS from the Command Line below.Now you can deploy your workflow, observe the deployment steps in real-time, and confirm in your VPC.

  1. In your workflow, click Deploy. The Start New Deployment dialog appears. Here you simply select the artifact build and version to be deployed.
  2. In Artifacts, click the dropdown menu and select the artifact build and version to deploy. The list is generated automatically by Harness from the artifact source you specified when you set up your service.

You can also elect to skip any instances that already have the artifact build and version. 3. Click SUBMIT to deploy. Harness shows the deployment in real-time:

Each workflow step is displayed. Click through each deployment step to see the logs and details.

Confirm Deployment in your Windows Instance

Now that the deployment was successful, confirm the website was added to the Windows instance(s):

  1. In your workflow Deployment page, click the Install step.

  2. Expand the Create Website section.

  3. In the log, note the location where the website was created:

INFO 2018-08-27 15:34:43 IIS-website 2 Started C:\Artifacts\IIS-website\relea http :8080:*
  1. Connect to your Windows instance via Microsoft Remote Desktop or other console.
  2. On the Windows instance, navigate to the location Harness reported to confirm the website was created:

Create an IIS Application and Virtual Directory Workflows

The steps for creating Workflows for IIS Applications and Virtual Directories are the same as the steps for creating a Workflow for an IIS Website, described above.

  1. Use the Harness Services you created for the IIS Application and Virtual Directory.
  2. Use the same Harness Environment and Infrastructure Definition you used to create the IIS Website Workflow.
  3. Deploy the IIS Virtual Directory Workflow first, then the IIS Application Workflow, and lastly the IIS Website Workflow. This sequence is best performed using a Harness Pipeline, described below.

Before deploying the IIS website, application, or virtual directory to your Windows instances, there must be an existing IIS Web Server Role on the instance. This ensures that the environment is ready for deployment. Harness IIS Website deployment requires the IIS Web Server Role. The Harness IIS Application and IIS Virtual Directory deployments require that an IIS Website exists. For more information, see Installing IIS from the Command Line below.

Deploy IIS Pipeline

Once you have workflows for your IIS website, application, and virtual directory set up, you can create a Harness pipeline that deploys them in the correct order. For IIS, you must deploy them in the order website, application, and then virtual directory.

In you Harness application, click Pipelines. Follow the steps in Add a Pipeline to add a stage for each of your workflows.

When you are done, the pipeline will look like this:

Click Deploy. The Start New Deployment dialog opens. Select each workflow artifact. When you are done, the dialog will look like this:

Click SUBMIT. Here's what the pipeline looks in the deployment dashboard. You can see each Stage was successful:

Next Step