Skip to main content

.NET Core installation and configuration in a container

Use this workflow with the Add New .NET Core agent wizard to ensure you have all the steps covered for installing and configuring the .NET Core agent with a container. Using the wizard is the simplest way to deploy a new agent.

Before you begin

Make sure you have everything you need before you start.

  • The agent will need to be able to reach your Contrast instance. It can be a local/on-premise instance or a hosted instance. A proxy can be configured if the environment has limited network access.

  • It must use supported technologies and system requirements

  • Understand the order of precedence

  • You will also need access to a command line interface (with a chosen directory for downloading the agent) and your organization's instance of Contrast

Start the .NET Core agent wizard

  1. Select Add New at the top of the Contrast web interface.

  2. Select the Application card.

  3. Under Select a language, select .NET Core.

  4. Select the operating system you are using.

Select method to deploy with containers

  1. Under Select application deployment method, select Install in a container.

  2. Under Select method, to deploy containers, select Dockerfile or Kubernetes (Linux only).

Dockerfile: Build image with agent

  1. Under Build image with agent, copy the displayed commands and add them to your Dockerfile.

  2. Use the displayed command to build the image.

Dockerfile: Configure the agent

Under Configure the agent, select the best options to get the configuration details that the agent needs to communicate with Contrast:

  1. Optionally, select Register the application.

    When you register an application, you can assign it to groups for access control. You can also assign tags and metadata to the application.

  2. For agent versions 4.2.22 and later, select Use Connection Token.

    This configuration method uses a single variable to specify authentication values. The Connection Token is the recommended configuration option.

    Copy the displayed code and set the variable in a location where the agent has access to it.

  3. For agent versions earlier than 4.2.22, select Use API configuration.

    This configuration method uses individual variables to specify authentication values.

    Copy the displayed code and set these variables in a location where the agent has access to them.

  4. If you prefer to configure the agent using a YAML file, select Download configuration.

    Copy the displayed code to generate a YAML file that contains your authentication settings.

Dockerfile: Add Contrast configuration to image

Under Add Contrast configuration to image, add the displayed command to your Dockerfile.

This command downloads the agent the configuration (YAML) file to the same location as your Dockerfile. Use this file to configure settings that you want to use across all instances of the application

Dockerfile: Run your container

Under Run your container, copy the displayed command to run the container.

Kubernetes: (Linux only)

  1. Under Select method to configure agent operator, select Helm (recommended) or Manifest.

  2. For Helm:

    1. Under Download and set up files, copy the displayed commands to create a values files.

    2. Under Label the deployments, use the displayed commands to label your deployments.

    3. Under Install and deploy Helm chart, copy the displayed commands to complete the configuration.

  3. For Manifest:

    1. Under Install operator, copy the displayed commands to install the Contrast agent operator.

    2. Under Configure operator, copy the displayed commands to configure the Contrast agent operator.

    3. Under Inject workloads, copy the displayed commands to configure an AgentInjector entity.

    4. Optionally, under Configure cluster agent and cluster, copy the displayed commands to configure these entities.

Verify the agent deployment

  1. Interact with your application as you normally would. For example, interact with your application's web interface or send API commands

  2. Go to the Contrast web interface and select Applications in the header.

  3. Verify that you see the name of your application in the list.

  4. Select servers in the header.

  5. Verify that you see the name of your local server in the list.