3 - IIS Environments in AWS and Azure

Updated 3 months ago by Michael Cretzman

This topic describes how to add Harness Service Infrastructures for target deployment environments in AWS and Azure:

For more information, see Add an Environment.

Create an Environment

To add an environment for your IIS Website, do the following:

  1. In your application, click Environments. The Environments page for the applications appears.
  2. Click Add Environment. The Environment dialog appears.
  3. Enter a name for your deployment environment, such as IIS-EC2, and then, in Environment Type, click Non-Production or Production. When you are finished, click SUBMIT. The Environment page appears.
    Next, you will add a Service Infrastructure/Infrastructure Definition, using the Cloud Provider you added to define where your IIS Website will be deployed.

Add an Infrastructure Definition

Infrastructure Definitions are a feature-flagged replacement for Service Infrastructure.

​Infrastructure Definitions specify the target deployment infrastructure for your Harness Services, and the specific infrastructure details for the deployment, like VPC settings. 

You define the Kubernetes cluster to use for deployment as an ​Infrastructure Definition. For this guide, we will use the GCP Cloud Provider you added and the Kubernetes cluster with Helm installed.

To add the Infrastructure Definition, do the following:

  1. In the Harness Environment, click Add Infrastructure Definition. The Infrastructure Definition dialog appears.
  2. In Name, enter the name you will use to select this Infrastructure Definition when you create a Workflow.
  3. In Cloud Provider Type, select the type of Cloud Provider you added earlier, such as Amazon Web Services, Microsoft Azure, etc. In the following steps we use the Amazon Web Services type, and so the settings are specific to AWS.
  4. In Deployment Type, select Windows Remote Management (WinRM).
  5. Click Use Already Provisioned Infrastructure. If you were using a Harness Infrastructure Provisioner, you would select Map Dynamically Provisioned Infrastructure.
  6. In Cloud Provider, select the Cloud Provider you added earlier.
  7. In Region, select the AWS region where you want to deploy. This list is populated using the Cloud Provider you selected.
  8. In Load Balancer, select the load balancer used by the VPC.
  9. In Connection Attribute, select the name of the WinRM Connection you created. This is the value you entered in Name when you created the WinRM Connection in Secrets Management.
  10. In Host Name Convention, in most cases, you can leave the default expression in this field.
    Host Name Convention is used to derive the instance(s) hostname. The hostname that results from the convention should be same as the output of the command hostname on the host itself.
    For information on obtaining the AWS instance hostname, see Instance Metadata and User Data from AWS.
  11. In Scope to specific Services, select the Harness Service you created earlier.
    The Infrastructure Definition will look something like this:

  12. Click Submit. The new Infrastructure Definition is added to the Harness Environment.

That is all you have to do to set up the deployment Environment in Harness.

Now that you have the Service and Environment set up. Now you can create the deployment Workflow in Harness.

AWS Infrastructure Definition

This following table describes the fields for an AWS EC2 Infrastructure Definition.

Field

What to Enter

Cloud Provider Type

Select the type of Cloud Provider you added earlier, such as Amazon Web Services.

Deployment Type

Select Windows Remote Management (WinRM).

Cloud Provider

Select the Cloud Provider you added.

Provision Type

If you have a Windows instance running in your Cloud Provider, click Already Provisioned. If you need to set up an instance, create the instance in your Cloud Provider, and then return to the Harness environment set up.If you have an Infrastructure Provisioner configured, select Dynamically Provisioned. This guide does not cover Harness Infrastructure Provisioners. For more information, see Add an Infra Provisioner.

Region

Region for the VPC.

Load Balancer

The load balancer used by the VPC.

WinRM Connection Attributes

Select the name of the WinRM Connection you created. This is the value you entered in Name when you created the WinRM Connection in Secrets Management.

Host Name Convention

Host Name Convention is used to derive the instance(s) hostname. The hostname that results from the convention should be same as the output of the command hostname on the host itself. Agent-based solutions like AppDynamics, Splunk, New Relic, etc, use the hostname to uniquely identify the instance.In most cases, you can leave the default expression in this field.For information on obtaining the AWS instance hostname, see Instance Metadata and User Data from AWS.

User Auto Scaling Group / Use AWS Instance Filter

User Auto Scaling Group: If you are using an Auto Scaling Group, you can select it from the list.Use AWS Instance Filter: Specify the VPC, Tags, Subnet, and Security Group where your instance(s) will be deployed.Using Tags is the easiest way to reference an instance.

Use Public DNS for connection

If locating the VPC requires public DNS name resolution, enable this option.

Scope to specific Services

Select the Harness Service you created for your IIS Website.

Azure Infrastructure Definition

You can locate most of the Azure information on the VM overview page:

This following table describes the fields for an Azure service infrastructure.

Field

What to Enter

Cloud Provider Type

Select the type of Cloud Provider you added earlier, such as Microsoft Azure.

Deployment Type

Select Windows Remote Management (WinRM).

Cloud Provider

Select the Cloud Provider you added.

Subscription ID

Select the Azure subscription to use.When you set up the Azure cloud provider in Harness, you entered the Client/Application ID for the Azure App registration. To access resources in your Azure subscription, you must assign the Azure app using this Client ID to a role in that subscription. Now, when you are setting up an Azure service infrastructure in a Harness environment, you select the subscription. If the Azure App registration using this Client ID is not assigned a role in a subscription, no subscriptions will be available.

For more information, see Assign the application to a role from Microsoft.

Resource Group

Select the resource group where your VM is located.

WinRM Connection Attributes

Select the name of the WinRM Connection you created. This is the value you entered in Name when you created the WinRM Connection in Secrets Management.

Tags

Click Add to use a tag to quickly select the VM you want to use.

Use Public DNS for connection

If locating the VM(s) requires public DNS name resolution, enable this option. Since the Harness delegate can only run on Linux, it must either be run on a Linux VM in the same subnet as your deployment target VMs or on a Linux server with network access to your Azure VMs. In the latter case, you can use public DNS to resolve the hostname of the target VMs.

Scope to specific Services

Select the Harness Service you created for your IIS Website.

Add a Service Infrastructure

Harness now uses Infrastructure Definitions (which are a feature-flagged replacement for Service Infrastructure).

To add a service infrastructure, do the following:

  1. Click Add Service Infrastructure. The Service Infrastructure dialog appears.
  2. Fill out the Service Infrastructure dialog using the following information.

When you are finished, the Service Infrastructure dialog will look something like this:

Click SUBMIT. The new service infrastructure is listed.

Next Step


How did we do?