Skip to content

Commit 42c117c

Browse files
authored
Merge pull request #281819 from ggailey777/fixup
[Functions] Public PR fix-ups
2 parents f2ba566 + dcc8c0b commit 42c117c

File tree

7 files changed

+110
-90
lines changed

7 files changed

+110
-90
lines changed

articles/azure-functions/configure-monitoring.md

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Configure monitoring for Azure Functions
33
description: Learn how to connect your function app to Application Insights for monitoring and how to configure data collection.
44
ms.service: azure-functions
55
ms.topic: how-to
6-
ms.date: 07/11/2024
6+
ms.date: 08/06/2024
77
ms.custom: devdivchpfy22
88

99
# 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
4848

4949
The following table describes the main categories of logs that the runtime creates:
5050

51-
# [v2.x+](#tab/v2)
51+
### [v2.x+](#tab/v2)
5252

5353
| Category | Table | Description |
5454
| ----- | ----- | ----- |
@@ -65,7 +65,7 @@ The following table describes the main categories of logs that the runtime creat
6565
> [!NOTE]
6666
> 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).
6767
68-
# [v1.x](#tab/v1)
68+
### [v1.x](#tab/v1)
6969

7070
| Category | Table | Description |
7171
| ----- | ----- | ----- |
@@ -90,7 +90,7 @@ The following examples define logging based on the following rules:
9090
+ `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.
9191
+ 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`.
9292

93-
# [v2.x+](#tab/v2)
93+
### [v2.x+](#tab/v2)
9494

9595
```json
9696
{
@@ -106,7 +106,7 @@ The following examples define logging based on the following rules:
106106
}
107107
```
108108

109-
# [v1.x](#tab/v1)
109+
### [v1.x](#tab/v1)
110110

111111
```json
112112
{
@@ -127,7 +127,7 @@ The following examples define logging based on the following rules:
127127

128128
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:
129129

130-
# [v2.x+](#tab/v2)
130+
### [v2.x+](#tab/v2)
131131

132132
```json
133133
{
@@ -143,7 +143,7 @@ If *[host.json]* includes multiple logs that start with the same string, the mor
143143
}
144144
```
145145

146-
# [v1.x](#tab/v1)
146+
### [v1.x](#tab/v1)
147147

148148
```json
149149
{
@@ -191,7 +191,7 @@ As noted in the previous section, the runtime aggregates data about function exe
191191

192192
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:
193193

194-
# [v2.x+](#tab/v2)
194+
### [v2.x+](#tab/v2)
195195

196196
```json
197197
{
@@ -209,7 +209,7 @@ Application Insights has a [sampling](../azure-monitor/app/sampling.md) feature
209209

210210
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.
211211

212-
# [v1.x](#tab/v1)
212+
### [v1.x](#tab/v1)
213213

214214
```json
215215
{
@@ -288,11 +288,21 @@ For a function app to send data to Application Insights, it needs to connect to
288288
| Setting name | Description |
289289
| ---- | ---- |
290290
| **[`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).|
292291
| **[`APPINSIGHTS_INSTRUMENTATIONKEY`](functions-app-settings.md#appinsights_instrumentationkey)** | Legacy setting, which Application Insights has deprecated in favor of the connection string setting. |
293292

294293
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.
295294

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.
305+
296306
[!INCLUDE [functions-app-insights-disable-local-note](../../includes/functions-app-insights-disable-local-note.md)]
297307

298308
### New function app in the portal

articles/azure-functions/functions-app-settings.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,16 @@ Don't use both `APPINSIGHTS_INSTRUMENTATIONKEY` and `APPLICATIONINSIGHTS_CONNECT
5858

5959
## APPLICATIONINSIGHTS_AUTHENTICATION_STRING
6060

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).
6262

63-
|Key|Sample value|
64-
|---|------------|
65-
|APPLICATIONINSIGHTS_AUTHENTICATION_STRING|`ClientId=<YOUR_CLIENT_ID>;Authorization=AAD`|
63+
When you use `APPLICATIONINSIGHTS_AUTHENTICATION_STRING`, the specific value that you set depends on the type of managed identity:
64+
65+
| Managed identity | Setting value |
66+
| ----- | ----- |
67+
| System-assigned | `Authorization=AAD` |
68+
| User-assigned | `Authorization=AAD;ClientId=<USER_ASSIGNED_CLIENT_ID>` |
69+
70+
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).
6671

6772
[!INCLUDE [functions-app-insights-disable-local-note](../../includes/functions-app-insights-disable-local-note.md)]
6873

@@ -79,7 +84,7 @@ For more information, see [Connection strings](../azure-monitor/app/sdk-connecti
7984
|---|------------|
8085
|APPLICATIONINSIGHTS_CONNECTION_STRING|`InstrumentationKey=...`|
8186

82-
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).
8388

8489
## AZURE_FUNCTION_PROXY_DISABLE_LOCAL_CALL
8590

articles/azure-functions/functions-bindings-register.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ The following table indicates when and how you register bindings.
1818
|Azure portal|Automatic|Automatic<sup>*</sup>|
1919
|Non-.NET languages|Automatic|Use [extension bundles](#extension-bundles) (recommended) or [explicitly install extensions](#explicitly-install-extensions)|
2020
|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)|
2222

2323
<sup>*</sup> Portal uses extension bundles, including C# script.
2424

articles/azure-functions/functions-continuous-deployment.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ GitHub Actions is the default build provider for GitHub projects. GitHub Actions
7070

7171
### [App Service (Kudu) service](#tab/app-service)
7272

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.
7474

7575
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.
7676

articles/azure-functions/functions-develop-vs-code.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -546,6 +546,9 @@ Replace `<BINDING_TYPE_NAME>` with the name of the package that contains the bin
546546

547547
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.
548548

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.
551+
549552
C# script uses [extension bundles](functions-bindings-register.md#extension-bundles).
550553

551554
::: zone-end

0 commit comments

Comments
 (0)