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
Copy file name to clipboardExpand all lines: articles/azure-functions/configure-monitoring.md
+20-10Lines changed: 20 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ title: Configure monitoring for Azure Functions
3
3
description: Learn how to connect your function app to Application Insights for monitoring and how to configure data collection.
4
4
ms.service: azure-functions
5
5
ms.topic: how-to
6
-
ms.date: 07/11/2024
6
+
ms.date: 08/06/2024
7
7
ms.custom: devdivchpfy22
8
8
9
9
# Customer intent: As a developer, I want to understand how to configure monitoring for my functions correctly, so I can collect the data that I need.
@@ -48,7 +48,7 @@ Category names are assigned differently in Functions compared to other .NET fram
48
48
49
49
The following table describes the main categories of logs that the runtime creates:
50
50
51
-
# [v2.x+](#tab/v2)
51
+
###[v2.x+](#tab/v2)
52
52
53
53
| Category | Table | Description |
54
54
| ----- | ----- | ----- |
@@ -65,7 +65,7 @@ The following table describes the main categories of logs that the runtime creat
65
65
> [!NOTE]
66
66
> For .NET class library functions, these categories assume you're using `ILogger` and not `ILogger<T>`. For more information, see the [Functions ILogger documentation](functions-dotnet-class-library.md#ilogger).
67
67
68
-
# [v1.x](#tab/v1)
68
+
###[v1.x](#tab/v1)
69
69
70
70
| Category | Table | Description |
71
71
| ----- | ----- | ----- |
@@ -90,7 +90,7 @@ The following examples define logging based on the following rules:
90
90
+`Host.Aggregator` and `Host.Results` are set to lower levels. Setting logging levels too high (especially higher than `Information`) can result in loss of metrics and performance data.
91
91
+ Logging for function runs is set to `Information`. If necessary, you can [override](functions-host-json.md#override-hostjson-values) this setting in local development to `Debug` or `Trace`.
92
92
93
-
# [v2.x+](#tab/v2)
93
+
###[v2.x+](#tab/v2)
94
94
95
95
```json
96
96
{
@@ -106,7 +106,7 @@ The following examples define logging based on the following rules:
106
106
}
107
107
```
108
108
109
-
# [v1.x](#tab/v1)
109
+
###[v1.x](#tab/v1)
110
110
111
111
```json
112
112
{
@@ -127,7 +127,7 @@ The following examples define logging based on the following rules:
127
127
128
128
If *[host.json]* includes multiple logs that start with the same string, the more defined logs ones are matched first. Consider the following example that logs everything in the runtime, except `Host.Aggregator`, at the `Error` level:
129
129
130
-
# [v2.x+](#tab/v2)
130
+
###[v2.x+](#tab/v2)
131
131
132
132
```json
133
133
{
@@ -143,7 +143,7 @@ If *[host.json]* includes multiple logs that start with the same string, the mor
143
143
}
144
144
```
145
145
146
-
# [v1.x](#tab/v1)
146
+
###[v1.x](#tab/v1)
147
147
148
148
```json
149
149
{
@@ -191,7 +191,7 @@ As noted in the previous section, the runtime aggregates data about function exe
191
191
192
192
Application Insights has a [sampling](../azure-monitor/app/sampling.md) feature that can protect you from producing too much telemetry data on completed executions at times of peak load. When the rate of incoming executions exceeds a specified threshold, Application Insights starts to randomly ignore some of the incoming executions. The default setting for maximum number of executions per second is 20 (five in version 1.x). You can configure sampling in [*host.json*](./functions-host-json.md#applicationinsights). Here's an example:
193
193
194
-
# [v2.x+](#tab/v2)
194
+
###[v2.x+](#tab/v2)
195
195
196
196
```json
197
197
{
@@ -209,7 +209,7 @@ Application Insights has a [sampling](../azure-monitor/app/sampling.md) feature
209
209
210
210
You can exclude certain types of telemetry from sampling. In this example, data of type `Request` and `Exception` is excluded from sampling. It ensures that *all* function executions (requests) and exceptions are logged while other types of telemetry remain subject to sampling.
211
211
212
-
# [v1.x](#tab/v1)
212
+
###[v1.x](#tab/v1)
213
213
214
214
```json
215
215
{
@@ -288,11 +288,21 @@ For a function app to send data to Application Insights, it needs to connect to
288
288
| Setting name | Description |
289
289
| ---- | ---- |
290
290
|**[`APPLICATIONINSIGHTS_CONNECTION_STRING`](functions-app-settings.md#applicationinsights_connection_string)**| This setting is recommended and is required when your Application Insights instance runs in a sovereign cloud. The connection string supports other [new capabilities](../azure-monitor/app/migrate-from-instrumentation-keys-to-connection-strings.md#new-capabilities). |
291
-
|**[`APPLICATIONINSIGHTS_AUTHENTICATION_STRING`](./functions-app-settings.md#applicationinsights_authentication_string)**| Connects to Application Insights using Microsoft Entra authentication. The value contains the client ID of either a system-assigned or a user-assigned managed identity that is authorized to publish telemetry to your Application Insights workspace. The string has a format of `ClientId=<YOUR_CLIENT_ID>;Authorization=AAD`. For more information, see [Microsoft Entra authentication for Application Insights](../azure-monitor/app/azure-ad-authentication.md).|
292
291
|**[`APPINSIGHTS_INSTRUMENTATIONKEY`](functions-app-settings.md#appinsights_instrumentationkey)**| Legacy setting, which Application Insights has deprecated in favor of the connection string setting. |
293
292
294
293
When you create your function app in the [Azure portal](./functions-get-started.md) from the command line by using [Azure Functions Core Tools](./create-first-function-cli-csharp.md) or [Visual Studio Code](./create-first-function-vs-code-csharp.md), Application Insights integration is enabled by default. The Application Insights resource has the same name as your function app, and is created either in the same region or in the nearest region.
295
294
295
+
### Require Microsoft Entra authentication
296
+
297
+
You can use the [`APPLICATIONINSIGHTS_AUTHENTICATION_STRING`](./functions-app-settings.md#applicationinsights_authentication_string) setting to enable connections to Application Insights using Microsoft Entra authentication. This creates a consistent authentication experience across all Application Insights pipelines, including Profiler and Snapshot Debugger, as well as from the Functions host and language-specific agents.
298
+
299
+
>[!NOTE]
300
+
>There's no Entra authentication support for local development.
301
+
302
+
The value contains either `Authorization=AAD` for a system-assigned managed identity or `ClientId=<YOUR_CLIENT_ID>;Authorization=AAD` for a user-assigned managed identity. The managed identity must already be available to the function app, with an assigned role equivalent to [Monitoring Metrics Publisher](/azure/role-based-access-control/built-in-roles/monitor#monitoring-metrics-publisher). For more information, see [Microsoft Entra authentication for Application Insights](../azure-monitor/app/azure-ad-authentication.md).
303
+
304
+
The [`APPLICATIONINSIGHTS_CONNECTION_STRING`](functions-app-settings.md#applicationinsights_connection_string) setting is still required.
Copy file name to clipboardExpand all lines: articles/azure-functions/functions-app-settings.md
+10-5Lines changed: 10 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -58,11 +58,16 @@ Don't use both `APPINSIGHTS_INSTRUMENTATIONKEY` and `APPLICATIONINSIGHTS_CONNECT
58
58
59
59
## APPLICATIONINSIGHTS_AUTHENTICATION_STRING
60
60
61
-
The connection string for Application Insights by using Microsoft Entra authentication. Use this setting when you must connect to your Application Insights workspace by using Microsoft Entra authentication. The string contains the client ID of either a system-assigned or a user-assigned managed identity that is authorized to publish telemetry to your Application Insights workspace. For more information, see [Microsoft Entra authentication for Application Insights](../azure-monitor/app/azure-ad-authentication.md).
61
+
Enables access to Application Insights by using Microsoft Entra authentication. Use this setting when you must connect to your Application Insights workspace by using Microsoft Entra authentication. For more information, see [Microsoft Entra authentication for Application Insights](../azure-monitor/app/azure-ad-authentication.md).
This authentication requirement is applied to connections from the Functions host, snapshot debugger, profiler, and any language-specific agents. To use this setting, the managed identity must already be available to the function app, with an assigned role equivalent to [Monitoring Metrics Publisher](/azure/role-based-access-control/built-in-roles/monitor#monitoring-metrics-publisher).
To connect to Application Insights with Microsoft Entra authentication, you should instead use [`APPLICATIONINSIGHTS_AUTHENTICATION_STRING`](#applicationinsights_authentication_string).
87
+
To connect to Application Insights with Microsoft Entra authentication, you should use [`APPLICATIONINSIGHTS_AUTHENTICATION_STRING`](#applicationinsights_authentication_string).
Copy file name to clipboardExpand all lines: articles/azure-functions/functions-bindings-register.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,7 @@ The following table indicates when and how you register bindings.
18
18
|Azure portal|Automatic|Automatic<sup>*</sup>|
19
19
|Non-.NET languages|Automatic|Use [extension bundles](#extension-bundles) (recommended) or [explicitly install extensions](#explicitly-install-extensions)|
20
20
|C# class library using Visual Studio|[Use NuGet tools](functions-develop-vs.md#add-bindings)|[Use NuGet tools](functions-develop-vs.md#add-bindings)|
21
-
|C# class library using Visual Studio Code|N/A|[Use .NET Core CLI](functions-develop-vs-code.md?tabs=csharp#install-binding-extensions)|
21
+
|C# class library using Visual Studio Code|N/A|[Use .NET Core CLI](functions-develop-vs-code.md?tabs=csharp#install-binding-extensions)<br/>[Use the C# Dev Kit](https://code.visualstudio.com/docs/csharp/package-management#_add-a-package)|
22
22
23
23
<sup>*</sup> Portal uses extension bundles, including C# script.
Copy file name to clipboardExpand all lines: articles/azure-functions/functions-continuous-deployment.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -70,7 +70,7 @@ GitHub Actions is the default build provider for GitHub projects. GitHub Actions
70
70
71
71
### [App Service (Kudu) service](#tab/app-service)
72
72
73
-
The App Service platform maintains a native deployment service ([Project Kudu](https://github.com/projectkudu/kudu/wiki)) to support local Git deployment, some container deployments, and other deployment sources not supported by either Pipelines or GitHub Actions. Remote builds, packaging, and other maintainence tasks are performed in a subdomain of `scm.azurewebsites.net` dedicated to your app, such as `https://myfunctionapp.scm.azurewebsites.net`. This build service can only be used when the `scm` site can be accessed by your deployment. Many publishing tools require basic authentication to connect to the `scm` endpoint, which means you can't use managed identities.
73
+
The App Service platform maintains a native deployment service ([Project Kudu](https://github.com/projectkudu/kudu/wiki)) to support local Git deployment, some container deployments, and other deployment sources not supported by either Pipelines or GitHub Actions. Remote builds, packaging, and other maintainence tasks are performed in a subdomain of `scm.azurewebsites.net` dedicated to your app, such as `https://myfunctionapp.scm.azurewebsites.net`. This build service can only be used when the `scm` site can be accessed by your deployment. While you can use identities to connect to the `scm` endpoint, many publishing tools instead require basic authentication to connect to the `scm` endpoint.
74
74
75
75
This build provider is used when you deploy your code project by using Visual Studio, Visual Studio Code, or Azure Functions Core Tools. If you haven't already deployed code to your function app by using one of these tools, you might need to [Enable basic authentication for deployments](#enable-basic-authentication-for-deployments) to use the `scm` site.
Copy file name to clipboardExpand all lines: articles/azure-functions/functions-develop-vs-code.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -546,6 +546,9 @@ Replace `<BINDING_TYPE_NAME>` with the name of the package that contains the bin
546
546
547
547
Replace `<TARGET_VERSION>` in the example with a specific version of the package, such as `3.0.0-beta5`. Valid versions are listed on the individual package pages at [NuGet.org](https://nuget.org). The major versions that correspond to the current Functions runtime are specified in the reference article for the binding.
548
548
549
+
>[!TIP]
550
+
>You can also use the **NuGet** commands in [the C# Dev Kit](https://code.visualstudio.com/docs/csharp/package-management#_add-a-package) to install binding extension packages.
0 commit comments