- 필수 기능
- 시작하기
- Glossary
- 표준 속성
- Guides
- Agent
- 통합
- 개방형텔레메트리
- 개발자
- Administrator's Guide
- API
- Datadog Mobile App
- CoScreen
- Cloudcraft
- 앱 내
- 서비스 관리
- 인프라스트럭처
- 애플리케이션 성능
- APM
- Continuous Profiler
- 스팬 시각화
- 데이터 스트림 모니터링
- 데이터 작업 모니터링
- 디지털 경험
- 소프트웨어 제공
- 보안
- AI Observability
- 로그 관리
- 관리
",t};e.buildCustomizationMenuUi=t;function n(e){let t='
",t}function s(e){let n=e.filter.currentValue||e.filter.defaultValue,t='${e.filter.label}
`,e.filter.options.forEach(s=>{let o=s.id===n;t+=``}),t+="${e.filter.label}
`,t+=`The Datadog extension for Azure App Service provides monitoring capabilities in addition to the Datadog-Azure integration, which provides metrics and logs.
Trace_ID
injection into application logs.Interested in support for other App Service resource types or runtimes? Sign up to be notified when a Preview becomes available.
The Datadog .NET, Java, and Node.js APM extensions support the following runtimes in Windows Code web apps:
Framework | Supported runtimes |
---|---|
.NET | ASPNET:V3.5 , ASPNET:V4.8 , dotnet:8 , dotnet:9 |
Java | JAVA:8 , JAVA:11 , JAVA:17 , JAVA:21 , TOMCAT:9.0-java8 , TOMCAT:9.0-java11 , TOMCAT:9.0-java17 , TOMCAT:9.0-java21 , TOMCAT:10.1-java8 , TOMCAT:10.1-java11 , TOMCAT:10.1-java17 , TOMCAT:10.1-java21 , TOMCAT:11.0-java8 , TOMCAT:11.0-java11 , TOMCAT:11.0-java17 , TOMCAT:11.0-java21 |
Node.js | NODE:20LTS , NODE:22LTS |
Datadog’s automatic instrumentation relies on the .NET CLR Profiling API. This API allows only one subscriber (for example, Datadog’s .NET Tracer with Profiler enabled). To ensure maximum visibility, run only one APM solution within your application environment.
Additionally, if you are using the Azure Native integration, you can use the Datadog resource in Azure to add the extension to your .NET apps. For instructions, see the App Service extension section of Datadog’s Azure Portal guide.
Support for Java Web Apps is in Preview for extension v2.4+.
There are no billing implications for tracing Java Web Apps during this period.
Datadog recommends doing regular updates to the latest version of the extension to ensure optimal performance, stability, and availability of features. Note that both the initial install and subsequent updates require your web app to be fully stopped in order to install/update successfully.
If you haven’t already, set up the Datadog-Azure integration.
Verify that your Datadog-Azure integration is configured correctly by ensuring that you see the azure.app_services.count
or azure.functions.count
metrics in Datadog.
In your Azure Portal, navigate to the dashboard for the Azure app you wish to instrument with Datadog.
Configure the following Application Settings:
Required environment variables
DD_API_KEY
DD_SITE
datadoghq.com
.Unified Service Tagging
Datadog recommends tagging your application with the env
, service
, and version
tags for unified service tagging.
DD_SERVICE
DD_ENV
DD_VERSION
Additional environment variables
DD_LOGS_INJECTION
true
(recommended)Click Save. This restarts your application.
Stop your application by clicking Stop.
In your Azure Portal, navigate to the Extensions page and select the Datadog APM extension.
Accept the legal terms, click OK, and wait for the installation to complete.
Start the main application, click Start:
Verify that the extension is installed and running by checking the Extensions page in your Azure Portal.
The Azure App Service extension includes an instance of DogStatsD, Datadog’s metrics aggregation service. This enables you to submit custom metrics, service checks, and events directly to Datadog from Azure Web Apps and Functions with the extension.
Writing custom metrics and checks in Azure App Service is similar to the process for doing so with an application on a host running the Datadog Agent. Unlike the standard DogStatsD config process, there is no need to set ports or a server name when initializing the DogStatsD configuration. There are ambient environment variables in Azure App Service that determine how the metrics are sent (requires v6.0.0+ of the DogStatsD client).
To submit custom metrics to Datadog from Azure App Service using the extension:
To send metrics, use this code:
// Configure your DogStatsd client and configure any tags
if (!DogStatsd.Configure(new StatsdConfig() { ConstantTags = new[] { "app:sample.mvc.aspnetcore" } }))
{
// `Configure` returns false if the necessary environment variables are not present.
// These environment variables are present in Azure App Service, but
// need to be set in order to test your custom metrics: DD_API_KEY:{api_key}, DD_AGENT_HOST:localhost
// Ignore or log the error as it suits you
Console.WriteLine("Cannot initialize DogstatsD.");
}
// Send a metric
DogStatsd.Increment("sample.startup");
To send metrics, use this code:
// Configure your DogStatsd client and configure any tags
StatsDClient client = new NonBlockingStatsDClientBuilder()
.constantTags("app:sample.service")
.build();
// Send a metric
client.Increment("sample.startup");
dd-trace
) packaged in the Azure App Service extension.To send metrics, use this code:
const tracer = require('dd-trace');
tracer.init();
tracer.dogstatsd.increment('example_metric.increment', 1, { environment: 'dev' });
tracer.dogstatsd.decrement('example_metric.decrement', 1, { environment: 'dev' });
dd-trace
, is packaged in the Azure App Services extension. It is automatically appended to the NODE_PATH
.dd-trace
as a dependency in package.json
. Explicitly adding dd-trace
as a dependency may override the version provided by the extension. For local testing, reference the release notes to find the appropriate version of the Node.js tracer for your version of the Azure App Service extension.Note: To send only custom metrics (while disabling tracing) set the following variables in your application’s config:
DD_TRACE_ENABLED
to false
.DD_AAS_ENABLE_CUSTOM_METRICS
to true
.Learn more about custom metrics.
You can send logs from your application in Azure App Service to Datadog in one of the following ways:
Both methods allow trace ID injection, making it possible to connect logs and traces in Datadog. To enable trace ID injection with the extension, add the application setting DD_LOGS_INJECTION:true
.
Sending logs from your application in Azure App Service to Datadog requires streaming logs to Datadog directly from your app. Submitting logs with this method allows for trace ID injection, which makes it possible to connect logs and traces in Datadog.
Sending logs from your application in Azure App Service to Datadog requires streaming logs to Datadog directly from your app. Submitting logs with this method allows for trace ID injection, which makes it possible to connect logs and traces in Datadog.
Configure these environment variables in your Azure App Service Application Settings for optimal log collection:
Variable | Description | Example |
---|---|---|
DD_SERVICE | Your application’s service name | my-web-app |
DD_ENV | Your application’s environment | production , staging , development |
DD_LOGS_INJECTION | Enable trace-log correlation | true |
DD_LOGS_INJECTION=true
to correlate logs with tracesDD_SERVICE
to ensure logs appear with the correct service nameNote: Trace ID injection occurs inside your application. Azure Resource logs are generated by Azure in the management plane, and therefore do not include the trace ID.
Code Example: Microsoft Native Logging
An example of how to set up logging in a .NET application using Microsoft.Extensions.Logging:
using Microsoft.Extensions.Logging;
public class WeatherForecastController : ControllerBase
{
private readonly ILogger<WeatherForecastController> _logger;
public WeatherForecastController(ILogger<WeatherForecastController> logger)
{
_logger = logger;
}
[HttpGet]
public IActionResult Get()
{
_logger.LogInformation("Processing weather forecast request");
// Your business logic here
var forecast = GetWeatherForecast();
_logger.LogInformation("Weather forecast retrieved for user: {UserId}", userId);
return Ok(forecast);
}
}
Program.cs configuration
using Microsoft.Extensions.Logging;
var builder = WebApplication.CreateBuilder(args);
// Configure logging
builder.Logging.ClearProviders();
builder.Logging.AddConsole();
builder.Logging.AddDebug();
// Add structured logging with JSON format
builder.Logging.AddJsonConsole(options =>
{
options.JsonWriterOptions = new JsonWriterOptions
{
Indented = true
};
});
var app = builder.Build();
// ... rest of your application configuration
appsettings.json configuration
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
},
"Console": {
"FormatterName": "json",
"FormatterOptions": {
"IncludeScopes": true,
"TimestampFormat": "yyyy-MM-dd HH:mm:ss "
}
}
}
}
This setup automatically includes trace correlation when DD_LOGS_INJECTION=true
is set in your Azure App Service Application Settings.
See instructions for Agentless logging with Java to configure application logging for Java in Azure App Service.
To configure application logging for Node.js in Azure App Service, see Agentless logging with Node.js.
Datadog provides scripts to update or install the Azure App Service Extension using Powershell. Scripted extension management enables you to update extensions in bulk by resource group and designate the installation of specific versions of the site extension. You can also use scripts to programmatically add the extension in CI/CD pipelines, as well as discover and update extensions that are already installed.
The install script adds the latest version of the extension to an Azure Web App or Azure Function App. This occurs on a per-app basis, rather than at a resource group level.
Open the Azure CLI or Azure Cloud Shell.
Download the installation script using the following command:
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/DataDog/datadog-aas-extension/master/management-scripts/extension/install-latest-extension.ps1" -OutFile "install-latest-extension.ps1"
Run the following command, passing in required and optional arguments as needed.
.\install-latest-extension.ps1 -Username <USERNAME> -Password <PASSWORD> -SubscriptionId <SUBSCRIPTION_ID> -ResourceGroup <RESOURCE_GROUP_NAME> -SiteName <SITE_NAME> -DDApiKey <DATADOG_API_KEY> -DDSite <DATADOG_SITE> -DDEnv <DATADOG_ENV> -DDService <DATADOG_SERVICE> -DDVersion <DATADOG_VERSION>
Note: The following arguments are required for the above command:
<USERNAME>
: Your Azure user scope username.<PASSWORD>
: Your Azure user scope password.<SUBSCRIPTION_ID>
: Your Azure subscription ID.<RESOURCE_GROUP_NAME>
: Your Azure resource group name.<SITE_NAME>
: The name of your app.<DATADOG_API_KEY>
: Your Datadog API key.Also, set DATADOG_SITE
to your Datadog site. DATADOG_SITE
defaults to datadoghq.com
. Your site is: .
The update script applies to an entire resource group. This script updates every Web App or Function App that has the extension installed. App Service apps that do not have the Datadog extension installed are not affected.
Open the Azure CLI or Azure Cloud Shell.
Download the update script using the following command:
$baseUri="https://raw.githubusercontent.com/DataDog/datadog-aas-extension/master/management-scripts/extension"; Invoke-WebRequest -Uri "$baseUri/update-all-site-extensions.ps1" -OutFile "update-all-site-extensions.ps1"; Invoke-WebRequest -Uri "$baseUri/install-latest-extension.ps1" -OutFile "install-latest-extension.ps1"
Run the following command. All arguments are required.
.\update-all-site-extensions.ps1 -SubscriptionId <SUBSCRIPTION_ID> -ResourceGroup <RESOURCE_GROUP_NAME> -Username <USERNAME> -Password <PASSWORD>
The Azure App Service UI does not support the ability to install a specific version of an extension. You may do this with the install or update script.
To install a specific version on a single instance, follow the instructions for installing the extension for the first time and add the -ExtensionVersion
parameter to the installation command.
.\install-latest-extension.ps1 -Username <USERNAME> -Password <PASSWORD> -SubscriptionId <SUBSCRIPTION_ID> -ResourceGroup <RESOURCE_GROUP_NAME> -SiteName <SITE_NAME> -DDApiKey <DATADOG_API_KEY> -ExtensionVersion <EXTENSION_VERSION>
Replace <EXTENSION_VERSION>
with the version of the extension you wish to install. For instance, 1.4.0
.
To install a specific version for a resource group, follow the instructions for updating the extension for a resource group and add the -ExtensionVersion
parameter to the installation command.
.\update-all-site-extensions.ps1 -SubscriptionId <SUBSCRIPTION_ID> -ResourceGroup <RESOURCE_GROUP_NAME> -Username <USERNAME> -Password <PASSWORD> -ExtensionVersion <EXTENSION_VERSION>
Replace <EXTENSION_VERSION>
with the version of the extension you wish to install. For instance, 1.4.0
.
Many organizations use Azure Resource Management (ARM) templates to implement the practice of infrastructure-as-code. To build the App Service Extension into these templates, incorporate Datadog’s App Service Extension ARM template into your deployments to add the extension and configure it alongside your App Service resources.
To update your Datadog instrumentation with zero downtime, use deployment slots. You can create a workflow that uses GitHub Action for Azure CLI.
See the sample GitHub workflow.
It is likely that you do not have the Azure integration configured to monitor your application. Proper configuration improves your ability to correlate metrics, traces, and logs in the Datadog platform. Without the Azure integration configured, you are missing critical context for your traces. To fix this:
Go to the Azure integration tile.
Ensure you have installed the Azure integration for the Azure subscription where your application is running.
Ensure that any App Service plan filtering rules you have applied include the App Service plan where the app is running. If an App Service plan is not included, all apps and functions hosted on it are also not included. Tags on the app itself are not used for filtering by Datadog.
Verify you’ve set DD_SITE
and DD_API_KEY
correctly.
Do a full stop and start of your application.
If not resolved, try uninstalling the extension and re-installing (this also ensures you are running the latest version).
Note: To expedite the process of investigating application errors with the support team, set DD_TRACE_DEBUG:true
and add the content of the Datadog logs directory (%AzureAppServiceHomeDirectory%\LogFiles\datadog
) to your email.
Still need help? Contact Datadog support.