Deploy and Monitor a .NET Core Application on Cloud Foundry

As a DX Application Performance Management (DX APM) for VMware Tanzu Administrator, you can deploy a .NET Core application to Pivotal Cloud Foundry (Cloud Foundry).
apmsaas
dxapm111
While deploying a .NET Core application to Cloud Foundry, you can configure the .NET Core Agent to monitor the application. After the configuration,
Application Performance Management
users can view the metrics in the
Application Performance Management
user interface.
Follow these high-level steps to use
Application Performance Management
for VMware Tanzu:
3
You can use Apps Manager or the Cloud Foundry Command Line Interface (cf CLI) to perform these steps.
Application Performance Management
for VMware Tanzu Prerequisites
Before you deploy, ensure that you can access these applications and components:
  • .NET Core application ready to deploy to Cloud Foundry
  • Pivotal
  • Redis for VMware Tanzu with Lua scripting enabled.
    If you already have Redis for VMware Tanzu installed, check whether Lua scripting is enabled. When scripting is not enabled, use the Ops Manager to enable it and re-install the Redis tile. You can enable Lua scripting in the
    Shared-VM-Plan
    and
    On-Demand-Plans
    configuration sections within the tile. You can also install or re-install Redis alongside
    Application Performance Management
    for VMware Tanzu.
Install
Application Performance Management
for VMware Tanzu
  1. If you have not already done so, download the
    DX Application Performance Management for VMware Tanzu
    tile package from the Pivotal Tanzu Network, or download the tile from here.
  2. In the Ops Manager Installation Dashboard, click
    Import a Product
    .
  3. Upload the
    DX Application Performance Management for VMware Tanzu
    tile package that you previously downloaded.
    A new unused product entry for
    DX Application Performance Management for VMware Tanzu
    displays.
  4. Click
    +
    next to
    DX Application Performance Management for VMware Tanzu
    under the unused products section.
  5. Click the newly added
    DX Application Performance Management for VMware Tanzu
    tile.
  6. Assign the tile to the same network to which you have assigned other services.
  7. Click
    Save
    .
  8. Return to the Installation Dashboard.
  9. Click
    Review Pending Changes
    or
    Install
    depending on your VMware Tanzu version.
  10. Click
    Apply
    .
    Application Performance Management
    for VMware Tanzu now installs. If you chose to install Redis for VMware Tanzu at the same time, Redis for VMware Tanzu is installed first.
  11. Validate the installation by running the
    cf marketplace -s introscope
    command.
    A plan listing for
    introscope
    should appear in the UI.
Create a Service Instance
You can create a service instance using the Apps Manager or cf CLI.
Create a Service Instance Using the Apps Manager
Follow these steps:
  1. Navigate to your space and click
    Add a Service
    .
  2. Click on
    DX Application Performance Management
    in the Services Marketplace listings.
  3. Choose the
    Standard
    plan, and click
    Select Plan
    .
  4. Provide a service instance name.
  5. In the
    Advanced Configuration
    section, supply the parameter values.
    1. Set the
      agent_manager_url
      parameter, which is required.
      • agent_manager_url
        (Required) The URL to an Enterprise Manager server or
        Application Performance Management
        SaaS tenant.
    2. Set more parameters, as appropriate for your environment.
      • agent_name
        (Optional) Name of the
        Application Performance Management
        for VMware Tanzu agent that monitors the application that is bound to the service instance.
      • agent_default_process_name
        (Optional) Name of the process that the agent is monitoring. The application name is used by default.
      • agent_manager_credential
        (Might be required by your organization.) The secret credential that authorizes an agent to access the
        Application Performance Management
        Enterprise Manager or
        Application Performance Management
        SaaS tenant.
  6. (Optional) You can bind this service instance to an application now, or can perform the bind later.
    1. Click
      Create
      to create the service instance.
      If the service instance creation fails, ensure that Lua scripting is enabled for your Redis for VMware Tanzu. Redis for VMware Tanzu is required for
      Application Performance Management
      for VMware Tanzu. Enable Lua scripting and reinstall Redis for VMware Tanzu in the Ops Manager. If Lua scripting is already enabled, contact Broadcom Support.
    2. Proceed to binding this service instance to an application.
Create a Service Instance Using the cf CLI
  1. Run the
    cf target
    command to verify that your cf CLI is authenticated and pointing to the correct organization and space.
  2. Create a service instance for use across platforms.
    When you create the
    Application Performance Management
    for VMware Tanzu service instance, you must set the
    agent_manager_url
    parameter, which is required.
    Here is an example:
    cf create-service introscope standard <
    your service instance name
    > -c '{"agent_manager_url" :"http://
    your.dx-apm.server.url
    "}
  3. If the service instance creation fails, ensure that Lua scripting is enabled for your Redis for VMware Tanzu deployment. Redis for VMware Tanzu is required for
    Application Performance Management
    for VMware Tanzu. Enable Lua scripting and reinstall Redis for VMware Tanzu in the Ops Manager. If Lua scripting is already enabled, contact Broadcom Support.
Bind an Application to a Service Instance
Bind the service instance to an application by using the Apps Manager, cf CLI, or application manifest.
Bind an Application to a Service Instance Using the Apps Manager
  1. If you chose to bind to an application when you created the service instance, proceed to push or restage the application.
  2. In Apps Manager, navigate to the
    Services
    tab of the application.
  3. Click
    Bind Service
    .
  4. Under the
    Service to Bind
    dropdown, select the service instance that you created.
  5. Click
    Bind
    to create the binding.
  6. Restage the application.
Bind an Application to a Service Instance Using the cf CLI
  1. Run the
    cf bind-service <
    application-name
    > <
    your service instance name
    >
    command to bind the application to the service instance.
  2. Restage the application.
Bind an Application to a Service Instance Using the Application Manifest
  1. Add
    <
    your service instance name
    >
    to the services section of the application manifest to bind the service instance to the application.
  2. Use the
    apmenv_
    environment variables to add more agent properties.
    The application manifest uses agent properties, not service instance parameters, for configuration.
    This example uses the
    http introscope.agent.errorsnapshots.throttle
    property:
    --- applications: - name: mvcmovie3 services: [ <
    your service instance name
    > ] timeout: 180 instances: 1 memory: 512M random-route: true env: apmenv_introscope_agent_errorsnapshots_throttle: 13
  3. Push the application.
Deploy a .NET Core Application Using the
Application Performance Management
for .NET Core Buildpack.
Use
one
of these methods to deploy a .NET Core application using a
Application Performance Management
.NET Core Buildpack.
  • Run the
    cf push<
    application-name
    > -b dx_dotnet_core_ext_buildpack -b <standard buildpack>
    command. For example:
    cf push mvcmovie3 -t 180 -b dx_dotnet_core_ext_buildpack -b dotnet_core_buildpack
  • Application manifest
    Use
    buildpacks
    and list multiple buildpack names.
Unbind an Application from a Service Instance
If you must remove
Application Performance Management
for VMware Tanzu from an application, you must unbind the associated service instance from the application. You must restage or push the application for any changes to take effect.
Unbind an Application from a Service Instance Using the Apps Manager
  1. Navigate to the application in the Apps Manager.
  2. Under the
    Service
    tab, a listing shows the services that are bound to the application.
  3. Access more options (three vertical dots) on the appropriate service instance that is displayed, and click
    unbind
    .
  4. Restage the application for the unbind changes to take effect.
Unbind an Application from a Service Instance Using the cf CLI
  1. Run the
    cf unbind-service <
    application-name
    > <
    service-instance-name
    >
    command to unbind the application.
  2. Restage or push the application for the changes to take effect.
Troubleshoot Application Deployment Failures
Symptom
The application deployment fails. The Cloud Foundry CLI displays a message stating that the deployment has failed. The application on Cloud Foundry is not instrumented.
Solution
  1. Review the Cloud Foundry logs
    • Run this command at a command prompt to access the logs:
      $ cf logs <
      Application_Name
      > --recent
  2. Ensure that the application name and path are correct in the
    manifest.yml
    file.