Skip to content

Latest commit

 

History

History
 
 

ARM

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 

Configuring Datadog in ARM Templates

To enable features such as Runtime Metrics or Logs Correlation, you can specify these in your appSettings section, or you can pass them as parameters similar to the other values specified in the example below.

{
    ...
    "parameters": {
        ...
        "dd_api_key": {
            "type": "String"
        },
        "dd_env": {
            "type": "String"
        },
        "dd_service": {
            "type": "String"
        },
        "dd_version": {
            "type": "String"
        },
        "dd_site": {
            "defaultValue": "datadoghq.com",
            "type": "String"
        }
    },
    ...
    "resources": [
        ...
        {
            "type": "Microsoft.Web/sites/config",
            ...
            "properties": {
                "appSettings": [
                    {
                        "name": "DD_API_KEY",
                        "value": "[parameters('dd_api_key')]"
                    },
                    {
                        "name": "DD_ENV",
                        "value": "[parameters('dd_env')]"
                    },
                    {
                        "name": "DD_SERVICE",
                        "value": "[parameters('dd_service')]"
                    },
                    {
                        "name": "DD_VERSION",
                        "value": "[parameters('dd_version')]"
                    },
                    {
                        "name": "DD_SITE",
                        "value": "[parameters('dd_site')]"
                    }
                ],
                ...
        },
        ...
        {
            "type": "Microsoft.Web/sites/siteextensions",
            "apiVersion": "2021-01-15",
            "name": "[concat(parameters('site_name'), '/Datadog.AzureAppServices.DotNet')]",
            "location": "[parameters('location')]",
            "dependsOn": [
                "[resourceId('Microsoft.Web/sites', parameters('site_name'))]"
            ]
        }
    ]
}

Pass the relevant parameters to your deployment command:

az deployment group create ... --parameters dd_api_key={{api-key}} dd_env={{env}} dd_service={{service}} dd_version={{version}} dd_site={{datadog-intake}}