3 - Azure Environment

Updated 3 weeks ago by Michael Cretzman

Once you've added a Service to your Application, you can define Environments where your Service can be deployed.

Create a New Harness Environment

In an Environment, you specify the following:

  • A Harness Service, such as the Service with a Docker image artifact you configured.
  • A Cloud Provider, such as the Kubernetes Cluster Cloud Provider that you added in Cloud Providers Setup.

An Environment can be a Dev, QA, Production, or other environment. You can deploy one or many Services to each environment.

The following procedure creates an Environment for the Service we set up earlier.

  1. In your Harness Application, click Environments. The Environments page appears.
  2. Click Add Environment. The Environment dialog appears.

  3. In Name, enter a name that describes the deployment environment, for example, AKS.
  4. In Environment Type, select Non-Production.
  5. Click SUBMIT. The new Environment page appears.

Add a Service Infrastructure

In Service Infrastructure, you define the AKS cluster to use for deployment.

To add a Service Infrastructure, do the following:

  1. In the Harness Environment, click Add Service Infrastructure. The Service Infrastructure dialog appears.

  2. In Service, select the Harness Service you created earlier.
  3. In Cloud Provider, select the Cloud Provider you added earlier. Ensure that you select the Kubernetes Cluster Cloud Provider you set up for the AKS connection and not the Azure Cloud Provider you set up for the ACR connection.
  4. Click Next.
  5. In Namespace, enter the name of the cluster namespace you want to use. As we noted in Namespace Variable, you can enter any value here and the Service will use it in its Namespace manifest to create the namespace at runtime.
  6. When you are done, the dialog will look something like this:

  7. Click SUBMIT. The new Service Infrastructure 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.

Your Environment can overwrite Service Config Variables, Config Files, and other settings. This enables you to have a Service keep its settings but have them changed when used with this Environment. For example, you might have a single Service but an Environment for QA and an Environment for Production, and you want to overwrite the values.yaml setting in the Service depending on the Environment. We don't overwrite any Services variables in this guide. For more information, see Override Service Settings in the Kubernetes Deployments doc.

Next Step

How did we do?