This page describes how to scale instrumentation of Azure Functions with the .NET Agent.

Add the AppDynamics Azure Site Extension Using an ARM Template

You can deploy the AppDynamics Azure Site Extension to Azure App Services using an Azure Resource Manager (ARM) template. This procedure uses Visual Studio Community 2017. 

To create and deploy an ARM template:

  1. From your web application in Visual Studio, choose File > New Project.
  2. Click Cloud, then click Azure Resource Group, then click OK.
  3. From the Select Azure Template dialog box, click Web App, then click OK.
  4. Under your newly-created Resource Group, click the Website.json file.
  5. Under JSON outline in the left pane, right-click resources, then choose Add New Resource.
  6. In the Add Resource dialog box, select Application Settings for Web Apps, enter a name, then click OK.
  7. Under the properties section, enter your AppDynamics Controller information. The following example shows the Website.json file with the application properties for AppDynamics.
  8. Add a new resource for the Site Extension, as shown in the following example:
{
      "apiVersion": "2015-08-01",
      "name": "[variables('webSiteName')]",
      "type": "Microsoft.Web/sites",
      "location": "[resourceGroup().location]",
      "tags": {
        "[concat('hidden-related:', resourceGroup().id, '/providers/Microsoft.Web/serverfarms/', parameters('hostingPlanName'))]": "Resource",
        "displayName": "Website"
      },
      "dependsOn": [
        "[resourceId('Microsoft.Web/serverfarms/', parameters('hostingPlanName'))]"
      ],
      "properties": {
        "name": "[variables('webSiteName')]",
        "serverFarmId": "[resourceId('Microsoft.Web/serverfarms', parameters('hostingPlanName'))]"
      },
      "resources": [
        {
          "apiVersion": "2016-08-01",
          "name": "appsettings",
          "type": "config",
          "dependsOn": [
            "[resourceId('Microsoft.Web/Sites', variables('webSiteName'))]"
          ],
          "properties": {
            "appdynamics.controller.hostName": "mycompany.saas.appdynamics.com",
            "appdynamics.controller.port": "443",
            "appdynamics.controller.ssl.enabled": "true",
            "appdynamics.agent.accountName": "mycompany",
            "appdynamics.agent.accountAccessKey": "[parameters('AppDAccessKeyInKeyVault')]",
            "appdynamics.agent.applicationName": "HelloWorldSecureAppDKey",
            "appdynamics.agent.tierName": "TestTier",
            "appdynamics.agent.nodeName": "TestNode"
          }
        },
        {
          "apiVersion": "2015-08-01",
          "name": "AppDynamics.WindowsAzure.SiteExtension.4.5.Release",
          "type": "siteextensions",
          "dependsOn": [
            "[resourceId('Microsoft.Web/Sites', variables('webSiteName'))]"
          ]
        },
CODE

Configure the Agent Using Environment Variables

If you want to configure the .NET Agent using environment variables, add the environment variables before you install the AppDynamics Azure Site Extension.


Configuring the .NET Agent using environment variables allows for unattended configuration. To configure agents in this manner, add the environment variables before you install the AppDynamics Azure Site Extension, as follows: 
  1. In the Azure Portal, open your Azure Function. 
  2. Navigate to Function app settings > Manage application settings.
  3. Click +New Application Setting and enter your environment variables as name/value pairs. 

The table below lists the available environment variables:

Environment Variable (Application Setting)Description (Value)Required
appdynamics.controller.hostNameHost associated with the Controller used by your Azure Function. Do not include http:// or https://

Yes

appdynamics.controller.portPort associated with your Controller. If the port is left blank or is invalid, defaults to 443.No
appdynamics.agent.accountNameAccount name associated with the Controller used by your Azure Function.Yes
appdynamics.agent.accountAccessKeyAccess key for your Controller. See Agent-to-Controller Connections.Yes
appdynamics.agent.applicationNameName of the Azure Function App.Yes
appdynamics.controller.ssl.enabledSets SSL connection to the Controller. Value "True" enables SSL, while value "False" disables SSL.No


For example:

Application Settings (Azure Portal)

Microsoft Azure, the Azure logo, Azure, and any other Microsoft Marks used in these materials are trademarks of Microsoft.com, Inc. or its affiliates in the United States and/or other countries.