Use the Java Agent with Azure Spring Cloud

You can activate the Java Agent with the Azure Spring Cloud apps in these two ways:

Activate with CLI

Activate the Splunk AppDynamics Java in-process Agent with Azure CLI.
  1. Create an instance of Azure Spring Cloud.
  2. Create an application:
    ```shell
    az spring-cloud app create --name "appName" --is-public true \
    -s "resourceName" -g "resourceGroupName"```
  3. Create a deployment with the Splunk AppDynamics agent and environment variables.
    You must access the APPDYNAMICS_AGENT_ACCOUNT_ACCESS_KEY, APPDYNAMICS_AGENT_ACCOUNT_NAME, and APPDYNAMICS_CONTROLLER_HOST_NAME to connect to AppDynamics and customize other variables as per your requirement.
    ```shell
    az spring-cloud app deploy --name "appName" --jar-path app.jar \
    -s "resourceName" -g "resourceGroupName" \
    --jvm-options="-javaagent:/opt/agents/appdynamics/java/javaagent.jar" \
    --env APPDYNAMICS_AGENT_APPLICATION_NAME=<YOUR_APPLICATION_NAME> \
    APPDYNAMICS_AGENT_ACCOUNT_ACCESS_KEY=<YOUR_AGENT_ACCESS_KEY> \
    APPDYNAMICS_AGENT_ACCOUNT_NAME=<YOUR_AGENT_ACCOUNT_NAME> \
    APPDYNAMICS_AGENT_NODE_NAME=<YOUR_AGENT_NODE_NAME> \
    APPDYNAMICS_AGENT_TIER_NAME=<YOUR_AGENT_TIER_NAME> \
    APPDYNAMICS_CONTROLLER_HOST_NAME=<YOUR_APPDYNAMICS_CONTROLLER_HOST_NAME> \
    APPDYNAMICS_CONTROLLER_SSL_ENABLED=true \
    APPDYNAMICS_CONTROLLER_PORT=443
Azure Spring Cloud pre-installs the Java Agent to the following path: /opt/agents/appdynamics/agent/javaagent.jar.

Activate with Azure portal

Activate the Splunk AppDynamics Java in-process Agent with Azure Portal.
  1. On the Azure portal, find the app you want to monitor by clicking Settings > Apps on the left navigation pane.
  2. Click the application to navigate to the Configuration page.
  3. Click Configuration on the left navigation pane to add, update, or, delete the environment variables of the application in the Environment variables tab.
  4. Click General settings to add, update or delete the JVM Options of the application in the General settings tab.
  5. Click Save.
  6. Click Restart to ensure the configuration is complete.