You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
text: 'Build secure and scalable Azure serverless applications with the Well-Architected Framework'
13
13
---
14
14
15
-
<divclass="alert alert-info">To instrument your Azure Container Apps applications with <code>serverless-init</code>, see <ahref="/serverless/guide/aca_serverless_init">Azure Container Apps with serverless-init</a>.</div>
15
+
<divclass="alert alert-info">To instrument your Azure Container Apps applications with an in-container Datadog Agent, see <ahref="/serverless/guide/aca_serverless_init">Azure Container Apps with serverless-init</a>.</div>
16
16
17
17
## Overview
18
-
Azure Container Apps is a fully managed serverless platform for deploying and scaling container-based applications. Datadog provides monitoring and log collection for Container Apps through the [Azure integration][1]. Datadog also provides a solution for instrumenting your Container Apps applications with a purpose-built Agent to enable tracing, custom metrics, and direct log collection.
18
+
Azure Container Apps is a fully managed serverless platform for deploying and scaling container-based applications. Datadog provides standard metrics and log collection for Container Apps through the [Azure integration][1]. Datadog also provides a solution for instrumenting your Container Apps applications with a purpose-built Agent to enable tracing, custom metrics, and direct log collection.
@@ -25,7 +25,7 @@ Azure Container Apps is a fully managed serverless platform for deploying and sc
25
25
26
26
Install the [Datadog-Azure integration][4] to collect metrics and logs.
27
27
28
-
### Application container
28
+
### Application
29
29
30
30
{{< tabs >}}
31
31
{{% tab "Node.js" %}}
@@ -36,19 +36,14 @@ Instrument your main application with the `dd-trace-js` library. See [Tracing No
36
36
Custom metrics are also collected through the tracer. See the [code examples][2].
37
37
38
38
#### Logs
39
-
The Datadog sidecar uses file tailing to collect logs.
40
-
41
-
In Azure, add a volume mount to the sidecar container *and* your application containers using [replica-scoped storage][5]. Use type "Ephemeral storage" when creating your volume. The examples on this page use the volume name `logs` and the mount path `/LogFiles`.
42
-
43
-
{{< img src="serverless/azure_container_apps/aca-volume-mount.png" alt="Adding a volume mount to a container in Azure" style="width:60%;" >}}
39
+
As an alternative to collecting logs through the Azure integration, you can use the Datadog sidecar with file tailing to collect application logs. Ensure that the logging path used in your application matches the path set in `DD_SERVERLESS_LOG_PATH` when setting up your sidecar in the [Instrumentation](#instrumentation) section.
44
40
45
41
To set up logging in your application, see [Node.js Log Collection][3]. To set up trace log correlation, see [Correlating Node.js Logs and Traces][4].
@@ -58,19 +53,14 @@ Instrument your main application with the `dd-trace-py` library. See [Tracing Py
58
53
Custom metrics are also collected through the tracer. See the [code examples][2].
59
54
60
55
#### Logs
61
-
The Datadog sidecar uses file tailing to collect logs.
62
-
63
-
In Azure, add a volume mount to the sidecar container *and* your application containers using [replica-scoped storage][5]. Use type "Ephemeral storage" when creating your volume. The examples on this page use the volume name `logs` and the mount path `/LogFiles`.
64
-
65
-
{{< img src="serverless/azure_container_apps/aca-volume-mount.png" alt="Adding a volume mount to a container in Azure" style="width:60%;" >}}
56
+
As an alternative to collecting logs through the Azure integration, you can use the Datadog sidecar with file tailing to collect application logs. Ensure that the logging path used in your application matches the path set in `DD_SERVERLESS_LOG_PATH` when setting up your sidecar in the [Instrumentation](#instrumentation) section.
66
57
67
58
To set up logging in your application, see [Python Log Collection][3]. To set up trace log correlation, see [Correlating Python Logs and Traces][4].
@@ -80,19 +70,14 @@ Instrument your main application with the `dd-trace-java` library. See [Tracing
80
70
Custom metrics are also collected through the tracer. See the [code examples][2].
81
71
82
72
#### Logs
83
-
The Datadog sidecar uses file tailing to collect logs.
84
-
85
-
In Azure, add a volume mount to the sidecar container *and* your application containers using [replica-scoped storage][5]. Use type "Ephemeral storage" when creating your volume. The examples on this page use the volume name `logs` and the mount path `/LogFiles`.
86
-
87
-
{{< img src="serverless/azure_container_apps/aca-volume-mount.png" alt="Adding a volume mount to a container in Azure" style="width:60%;" >}}
73
+
As an alternative to collecting logs through the Azure integration, you can use the Datadog sidecar with file tailing to collect application logs. Ensure that the logging path used in your application matches the path set in `DD_SERVERLESS_LOG_PATH` when setting up your sidecar in the [Instrumentation](#instrumentation) section.
88
74
89
75
To set up logging in your application, see [Java Log Collection][3]. To set up trace log correlation, see [Correlating Java Logs and Traces][4].
@@ -102,19 +87,14 @@ Instrument your main application with the `dd-trace-go` library. See [Tracing Go
102
87
Custom metrics are also collected through the tracer. See the [code examples][2].
103
88
104
89
#### Logs
105
-
The Datadog sidecar uses file tailing to collect logs.
106
-
107
-
In Azure, add a volume mount to the sidecar container *and* your application containers using [replica-scoped storage][5]. Use type "Ephemeral storage" when creating your volume. The examples on this page use the volume name `logs` and the mount path `/LogFiles`.
108
-
109
-
{{< img src="serverless/azure_container_apps/aca-volume-mount.png" alt="Adding a volume mount to a container in Azure" style="width:60%;" >}}
90
+
As an alternative to collecting logs through the Azure integration, you can use the Datadog sidecar with file tailing to collect application logs. Ensure that the logging path used in your application matches the path set in `DD_SERVERLESS_LOG_PATH` when setting up your sidecar in the [Instrumentation](#instrumentation) section.
110
91
111
92
To set up logging in your application, see [Go Log Collection][3]. To set up trace log correlation, see [Correlating Go Logs and Traces][4].
@@ -124,19 +104,14 @@ Instrument your main application with the `dd-trace-dotnet` library. See [Tracin
124
104
Custom metrics are also collected through the tracer. See the [code examples][2].
125
105
126
106
#### Logs
127
-
The Datadog sidecar uses file tailing to collect logs.
128
-
129
-
In Azure, add a volume mount to the sidecar container *and* your application containers using [replica-scoped storage][5]. Use type "Ephemeral storage" when creating your volume. The examples on this page use the volume name `logs` and the mount path `/LogFiles`.
130
-
131
-
{{< img src="serverless/azure_container_apps/aca-volume-mount.png" alt="Adding a volume mount to a container in Azure" style="width:60%;" >}}
107
+
Instead of collecting logs through the Azure integration, alternatively you can use the Datadog sidecar with file tailing to collect application logs. Ensure that the logging path used in your application matches the path set in `DD_SERVERLESS_LOG_PATH` when setting up your sidecar in the [Instrumentation](#instrumentation) section.
132
108
133
109
To set up logging in your application, see [.NET Log Collection][3]. To set up trace log correlation, see [Correlating .NET Logs and Traces][4].
@@ -146,30 +121,102 @@ Instrument your main application with the `dd-trace-php` library. See [Tracing P
146
121
Custom metrics are also collected through the tracer. See the [code examples][2].
147
122
148
123
#### Logs
149
-
The Datadog sidecar uses file tailing to collect logs.
150
-
151
-
In Azure, add a volume mount to the sidecar container *and* your application containers using [replica-scoped storage][5]. Use type "Ephemeral storage" when creating your volume. The examples on this page use the volume name `logs` and the mount path `/LogFiles`.
152
-
153
-
{{< img src="serverless/azure_container_apps/aca-volume-mount.png" alt="Adding a volume mount to a container in Azure" style="width:60%;" >}}
124
+
As an alternative to collecting logs through the Azure integration, you can use the Datadog sidecar with file tailing to collect application logs. Ensure that the logging path used in your application matches the path set in `DD_SERVERLESS_LOG_PATH` when setting up your sidecar in the [Instrumentation](#instrumentation) section.
154
125
155
126
To set up logging in your application, see [PHP Log Collection][3]. To set up trace log correlation, see [Correlating PHP Logs and Traces][4].
Because Azure Container Apps is built on Kubernetes, you cannot share environment variables between containers. You must set Datadog environment variables on both your application and sidecar containers.
135
+
### Instrumentation
136
+
137
+
{{< tabs >}}
138
+
{{% tab "Terraform" %}}
139
+
140
+
The [Datadog Terraform module for Container Apps][1] wraps the [`azurerm_container_app`][2] resource and automatically configures your Container App for Datadog Serverless Monitoring by adding required environment variables and the serverless-init sidecar.
141
+
142
+
If you don't already have Terraform set up, [install Terraform][3], create a new directory, and make a file called `main.tf`.
143
+
144
+
Then, add the following to your Terraform configuration, updating it as necessary based on your needs:
145
+
146
+
```tf
147
+
variable "datadog_api_key" {
148
+
description = "Your Datadog API key"
149
+
type = string
150
+
sensitive = true
151
+
}
152
+
153
+
provider "azurerm" {
154
+
features {}
155
+
subscription_id = "00000000-0000-0000-0000-000000000000" // Replace with your subscription ID
Because Azure Container Apps is built on Kubernetes, you cannot share environment variables between containers.
167
214
168
215
| Name | Description |
169
216
| ---- | ----------- |
170
217
|`DD_SERVICE`| How you want to tag your service. For example, `sidecar-azure`. |
171
218
|`DD_ENV`| How you want to tag your env. For example, `prod`.|
172
-
|`DD_VERSION`| How you want to tag your version. |
219
+
|`DD_VERSION`| How you want to tag your application version. |
173
220
174
221
### Sidecar container
175
222
1. In the Azure Portal, navigate to **Application** > **Revisions and replicas**. Select **Create new revision**.
@@ -184,7 +231,7 @@ Because Azure Container Apps is built on Kubernetes, you cannot share environmen
184
231
4. Add a volume mount using [replica-scoped storage][2]. Use type "Ephemeral storage" when creating your volume. Ensure that the name and mount path matches the mount you configured in the application container.
185
232
5. Set the environment variables in the following table:
186
233
187
-
#### Environment variables
234
+
#### Sidecar Environment variables
188
235
| Name | Description |
189
236
| ---- | ----------- |
190
237
|`DD_AZURE_SUBSCRIPTION_ID`|**Required**. Your Azure subscription ID. |
@@ -193,8 +240,18 @@ Because Azure Container Apps is built on Kubernetes, you cannot share environmen
|`DD_SERVICE`| How you want to tag your service. For example, `sidecar-azure`. |
195
242
|`DD_ENV`| How you want to tag your env. For example, `prod`.|
196
-
|`DD_VERSION`| How you want to tag your version. |
197
-
|`DD_SERVERLESS_LOG_PATH`| Where you write your logs. For example, `/LogFiles/*.log`. |
243
+
|`DD_VERSION`| How you want to tag your application version. |
244
+
|`DD_SERVERLESS_LOG_PATH`| If using the agent for log collection, where you write your logs. For example, `/LogFiles/*.log`. This must match the logging path set up in [Application](#application)|
245
+
246
+
### Logging
247
+
248
+
If using the Datadog Agent for log collection, add a volume mount to the sidecar container *and* your application containers using [replica-scoped storage][2]. Use type **Ephemeral storage** when creating your volume. The examples on this page use the volume name `logs` and the mount path `/LogFiles`.
249
+
250
+
{{< img src="serverless/azure_container_apps/aca-volume-mount.png" alt="Adding a volume mount to a container in Azure" style="width:60%;" >}}
0 commit comments