Skip to content

Commit eba53e4

Browse files
azure app service updates (DataDog#16384)
* Add Linux App Services Adding a new section for Linux Azure App Services setup * making edits * Add Linux App Services Adding a new section for Linux Azure App Services setup * rebasing * updating images * finishing up * Update azure_app_services_linux.md * fixing * ugh * fixing * adding things * adding more * fixing python * edits * fixing java * adding more * adding troubleshooting --------- Co-authored-by: Danny-Driscoll <daniel.driscoll@optimizely.com> Co-authored-by: Danny-Driscoll <danny.driscoll@datadoghq.com>
1 parent 7751475 commit eba53e4

File tree

9 files changed

+192
-22
lines changed

9 files changed

+192
-22
lines changed

config/_default/menus/menus.en.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -867,6 +867,14 @@ main:
867867
parent: serverless
868868
identifier: serverless_app_services
869869
weight: 2
870+
- name: Linux
871+
url: serverless/azure_app_services/azure_app_services_linux
872+
parent: serverless_app_services
873+
weight: 201
874+
- name: Windows
875+
url: serverless/azure_app_services/azure_app_services_windows
876+
parent: serverless_app_services
877+
weight: 202
870878
- name: Azure Container Apps
871879
url: serverless/azure_container_apps
872880
parent: serverless
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
---
2+
title: Monitoring Azure App Service
3+
kind: documentation
4+
aliases:
5+
- /infrastructure/serverless/azure_app_services/
6+
further_reading:
7+
- link: "/integrations/azure_app_services/"
8+
tag: "Documentation"
9+
text: "Azure App Service"
10+
- link: "/integrations/azure_app_service_environment/"
11+
tag: "Documentation"
12+
text: "Azure App Service Environment"
13+
- link: "https://www.datadoghq.com/blog/azure-app-service-extension/"
14+
tag: "Blog"
15+
text: "Monitor .NET web apps with the Datadog extension for Azure App Service"
16+
- link: "https://www.datadoghq.com/pricing/?product=apm--continuous-profiler#apm--continuous-profiler-what-is-considered-as-a-host-for-azure-app-services"
17+
tag: "Pricing"
18+
text: "Azure App Service APM Pricing"
19+
- link: "https://www.datadoghq.com/blog/deploy-dotnet-core-azure-app-service/"
20+
tag: "Blog"
21+
text: "Deploy ASP.NET Core applications to Azure App Service"
22+
23+
---
24+
25+
## Overview
26+
27+
Microsoft [Azure App Service][1] is a group of serverless resources that enable you to build and host web apps, mobile backends, event-driven functions, and RESTful APIs without managing infrastructure. It can host workloads of all sizes and offers auto-scaling and high availability options.
28+
29+
Datadog provides monitoring capabilities for all Azure App Service resource types:
30+
31+
- Azure Monitor metrics for [Apps][2] and [Functions][3] using the [Azure Integration][2].
32+
- Use the [Azure App Service View][4] to quickly spot issues, map relationships between your Azure App Service resources, and gain insights into cost and performance.
33+
- Submit custom metrics through the API.
34+
- Submit [resource logs][5] through [Event Hub][6].
35+
36+
Datadog provides additional monitoring capabilities for the following Azure App Service workload runtimes on Basic, Standard, and Premium plans:
37+
38+
| OS | Runtime |Status|Documentation|
39+
|----|---------|----|----|
40+
|Windows|.NET|GA|[Windows .NET setup][7]|
41+
|Windows|Java|Beta|[Windows Java setup][8]|
42+
|Linux|.NET|Beta|[Linux docs][9]|
43+
|Linux|Node|Beta|[Linux docs][9]|
44+
45+
Capabilities:
46+
- Fully distributed APM tracing using automatic instrumentation
47+
- Customized APM service and trace views showing relevant Azure App Service metrics and metadata
48+
- Manual APM instrumentation to customize spans
49+
- `Trace_ID` injection into application logs
50+
- Custom metrics with [DogStatsD][7]
51+
52+
53+
[1]: /integrations/azure/#log-collection
54+
[2]: /tracing/trace_collection/dd_libraries/
55+
[3]: https://registry.hub.docker.com/r/datadog/serverless-init
56+
[4]: /metrics/custom_metrics/dogstatsd_metrics_submission/
57+
[5]: /getting_started/site/
58+
[6]: /getting_started/tagging/unified_service_tagging/
59+
[7]: /serverless/azure_app_services/azure_app_services_windows?tab=net#setup
60+
[8]: /serverless/azure_app_services/azure_app_services_windows?tab=java#setup
61+
[9]: /serverless/azure_app_services/azure_app_services_linux
Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
---
2+
title: Azure App Service - Linux
3+
kind: documentation
4+
---
5+
## Overview
6+
7+
This instrumentation method provides the following additional monitoring capabilities for Linux Azure App Service workloads:
8+
9+
- Fully distributed APM tracing using automatic instrumentation.
10+
- Customized APM service and trace views showing relevant Azure App Service metrics and metadata.
11+
- Support for manual APM instrumentation to customize spans.
12+
- `Trace_ID` injection into application logs.
13+
- Support for submitting custom metrics using [DogStatsD][1].
14+
15+
This solution uses the startup command setting and Application Settings for Linux Azure App Service to instrument the application and manage its configuration. Java, Node, .NET, PHP, and Python are supported.
16+
17+
### Setup
18+
#### Set application settings
19+
To instrument your application, begin by adding the following key-value pairs under **Application Settings** in your Azure configuration settings.
20+
21+
{{< img src="serverless/azure_app_service/application-settings.jpg" alt="Azure App Service Configuration: the Application Settings, under the Configuration section of Settings in the Azure UI. Three settings are listed: DD_API_KEY, DD_SERVICE, and DD_START_APP." style="width:80%;" >}}
22+
23+
- `DD_API_KEY` is your Datadog API key.
24+
- `DD_CUSTOM_METRICS_ENABLED` (optional) enables [custom metrics](#custom-metrics).
25+
- `DD_SITE` is the Datadog site [parameter][2]. Your site is {{< region-param key="dd_site" code="true" >}}. This value defaults to `datadoghq.com`.
26+
- `DD_SERVICE` is the service name used for this program. Defaults to the name field value in `package.json`.
27+
- `DD_START_APP` is the command used to start your application. For example, `node ./bin/www`.
28+
29+
### Identifying your startup command
30+
31+
Linux Azure App Service Web Apps built using the code deployment option on built-in runtimes depend on a startup command that varies by language. The default values are outlined in [Azure's documentation][7]. Examples are included below.
32+
33+
Set these values in the `DD_START_APP` environment variable. Examples below are for an application named `datadog-demo`, where relevant.
34+
35+
| Runtime | `DD_START_APP` Example Value | Description
36+
| ---- | --- | --- |
37+
| Node.js | `node ./bin/www` | Runs the [Node PM2 configuration file][12], or your script file |
38+
| .NET Core | `dotnet datadog-demo.dll` | Runs a .dll file that uses your Web App name by default |
39+
| PHP | `cp /home/site/wwwroot/default /etc/nginx/sites-available/default && service nginx reload` | Copies script to correct location and starts application |
40+
| Python | `gunicorn --bind=0.0.0.0 --timeout 600 quickstartproject.wsgi` | Custom [startup script][13]. This example shows a Gunicorn command for starting a Django app. |
41+
| Java | `java -jar /home/site/wwwroot/datadog-demo.jar` | The command to start your app |
42+
43+
[7]: https://learn.microsoft.com/en-us/troubleshoot/azure/app-service/faqs-app-service-linux#what-are-the-expected-values-for-the-startup-file-section-when-i-configure-the-runtime-stack-
44+
[12]: https://learn.microsoft.com/en-us/azure/app-service/configure-language-nodejs?pivots=platform-linux#configure-nodejs-server
45+
[13]: https://learn.microsoft.com/en-us/azure/app-service/configure-language-php?pivots=platform-linux#customize-start-up
46+
47+
48+
**Note**: The application restarts when new settings are saved.
49+
50+
#### Set General Settings
51+
52+
{{< tabs >}}
53+
{{% tab "Node, .NET, PHP, Python" %}}
54+
Go to **General settings** and add the following to the **Startup Command** field:
55+
56+
```
57+
curl -s https://raw.githubusercontent.com/DataDog/datadog-aas-linux/v1.1.0/datadog_wrapper | bash
58+
```
59+
60+
{{< img src="serverless/azure_app_service/startup-command-1.jpeg" alt="Azure App Service Configuration: the Stack settings, under the Configuration section of Settings in the Azure UI. Underneath the stack, major version, and minor version fields is a 'Startup Command' field that is populated by the above curl command." style="width:100%;" >}}
61+
{{% /tab %}}
62+
{{% tab "Java" %}}
63+
Download the [`datadog_wrapper`][8] file from the releases and upload it to your application with the Azure CLI command:
64+
65+
```
66+
az webapp deploy --resource-group <group-name> --name <app-name> --src-path <path-to-datadog-wrapper> --type=startup
67+
```
68+
69+
Alternatively, you can upload this script as part of your application and set the startup command in general settings as its location (for example, `/home/site/wwwroot/datadog_wrapper`.)
70+
71+
If you are already using a startup script, add the following curl command to the end of your script:
72+
73+
```
74+
curl -s https://raw.githubusercontent.com/DataDog/datadog-aas-linux/v1.1.0/datadog_wrapper | bash
75+
```
76+
77+
[8]: https://github.com/DataDog/datadog-aas-linux/releases
78+
{{% /tab %}}
79+
{{< /tabs >}}
80+
81+
### Viewing traces
82+
83+
When new Application Settings are saved, Azure restarts the application. However, if a startup command is added and saved, a restart may be required.
84+
85+
After the application restarts, you can view traces by searching for the service name (`DD_SERVICE`) in the [APM Service page][4] of Datadog.
86+
87+
### Custom metrics
88+
89+
To enable custom metrics for your application with DogStatsD, add `DD_CUSTOM_METRICS_ENABLED` and set it as `true` in your Application Settings.
90+
91+
To configure your application to submit metrics, follow the appropriate steps for your runtime.
92+
93+
- [Java][9]
94+
- [Node][5]
95+
- [.NET][6]
96+
- [PHP][10]
97+
- [Python][11]
98+
99+
## Troubleshooting
100+
101+
If you are not receiving traces or custom metric data as expected, enable **App Service logs** to receive debugging logs.
102+
103+
{{< img src="serverless/azure_app_service/app-service-logs.png" alt="Azure App Service Configuration: App Service logs, under the Monitoring section of Settings in the Azure UI. The 'Application logging' option is set to 'File System'." style="width:100%;" >}}
104+
105+
Share the content of the **Log stream** with [Datadog Support][14].
106+
107+
[1]: /developers/dogstatsd
108+
[2]: /getting_started/site/#access-the-datadog-site
109+
[3]: https://www.datadoghq.com/blog/azure-app-service-datadog-serverless-view/
110+
[4]: /tracing/services/service_page/
111+
[5]: https://github.com/brightcove/hot-shots
112+
[6]: /developers/dogstatsd/?tab=hostagent&code-lang=dotnet#code
113+
[9]: https://docs.datadoghq.com/developers/dogstatsd/?tab=hostagent&code-lang=java
114+
[10]: https://docs.datadoghq.com/developers/dogstatsd/?tab=hostagent&code-lang=php
115+
[11]: https://docs.datadoghq.com/developers/dogstatsd/?tab=hostagent&code-lang=python
116+
[14]: /help

content/en/serverless/azure_app_services.md renamed to content/en/serverless/azure_app_services/azure_app_services_windows.md

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Microsoft Azure App Service Extension
2+
title: Azure App Service - Windows
33
kind: documentation
44
aliases:
55
- /infrastructure/serverless/azure_app_services/
@@ -24,22 +24,13 @@ further_reading:
2424

2525
## Overview
2626

27-
Microsoft [Azure App Services][1] is a group of serverless resources that enable you to build and host web apps, mobile back ends, event-driven functions, and RESTful APIs without managing infrastructure. It can host workloads of all sizes and offers auto-scaling and high availability options.
28-
29-
Datadog provides monitoring capabilities for all Azure App Service resource types:
30-
31-
- Azure Monitor metrics for [Apps][2] and [Functions][3] using the [Azure Integration][2].
32-
- Use the [Azure App Service View][4] to quickly spot issues, map relationships between your Azure App Service resources, and gain insights into cost and performance.
33-
- Custom metrics can be submitted using the API.
34-
- [Resource logs][5] can be submitted using [Event Hub][6].
35-
3627
The Datadog extension for Azure App Service provides additional monitoring capabilities.
3728

3829
- Full distributed APM tracing using automatic instrumentation.
3930
- Customized APM service and trace views showing relevant Azure App Service metrics and metadata.
4031
- Support for manual APM instrumentation to customize spans.
4132
- `Trace_ID` injection into application logs.
42-
- Support for submitting custom metrics using [DogStatsD][7].
33+
- Support for submitting custom metrics using [DogStatsD][1].
4334

4435
## Setup
4536

@@ -369,7 +360,7 @@ It is likely that you do not have the Azure integration configured to monitor yo
369360
370361
1. Go to the Azure integration tile.
371362
372-
2. Ensure you have installed the [Azure integration][8] for the Azure subscription where your application is running.
363+
2. Ensure you have installed the [Azure integration][2] for the Azure subscription where your application is running.
373364
374365
3. 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.
375366
@@ -384,19 +375,13 @@ It is likely that you do not have the Azure integration configured to monitor yo
384375
385376
**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.
386377
387-
Still need help? Contact [Datadog support][9].
378+
Still need help? Contact [Datadog support][3].
388379
389380
### Further Reading
390381
391382
{{< partial name="whats-next/whats-next.html" >}}
392383
393384
394-
[1]: https://docs.microsoft.com/en-us/azure/app-service/
395-
[2]: /integrations/azure_app_services/
396-
[3]: /integrations/azure_functions/
397-
[4]: https://app.datadoghq.com/functions?cloud=azure&config_serverless-azure-app=true&group=service
398-
[5]: https://docs.microsoft.com/en-us/azure/azure-monitor/platform/resource-logs
399-
[6]: /integrations/azure/?tab=eventhub#log-collection
400-
[7]: /developers/dogstatsd
401-
[8]: /integrations/azure
402-
[9]: /help
385+
[1]: /developers/dogstatsd
386+
[2]: /integrations/azure
387+
[3]: /help
143 KB
Loading
91.5 KB
Loading
170 KB
Loading
148 KB
Loading
92.5 KB
Loading

0 commit comments

Comments
 (0)