Skip to content

Commit 6efcd83

Browse files
Merge pull request #252365 from ggailey777/dotnet
[Functions] article clean-up based on tag scanning
2 parents 3a01615 + 93cb464 commit 6efcd83

8 files changed

+91
-68
lines changed

articles/azure-functions/functions-bindings-azure-data-explorer-output.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ For information on setup and configuration details, see the [overview](functions
2222

2323
[!INCLUDE [functions-bindings-csharp-intro-with-csx](../../includes/functions-bindings-csharp-intro-with-csx.md)]
2424

25-
# [In-process](#tab/in-process)
25+
### [In-process](#tab/in-process)
2626

2727
More samples for the Azure Data Explorer output binding are available in the [GitHub repository](https://github.com/Azure/Webjobs.Extensions.Kusto/tree/main/samples/samples-csharp).
2828

@@ -54,7 +54,7 @@ public class Product
5454

5555
<a id="http-trigger-write-one-record-c"></a>
5656

57-
### HTTP trigger, write one record
57+
#### HTTP trigger, write one record
5858

5959
The following example shows a [C# function](functions-dotnet-class-library.md) that adds a record to a database. The function uses data provided in an HTTP POST request as a JSON body.
6060

@@ -92,7 +92,7 @@ namespace Microsoft.Azure.WebJobs.Extensions.Kusto.Samples.OutputBindingSamples
9292

9393
<a id="http-trigger-write-to-two-tables-c"></a>
9494

95-
### HTTP trigger, write to two tables
95+
#### HTTP trigger, write to two tables
9696

9797
The following example shows a [C# function](functions-dotnet-class-library.md) that adds records to a database in two different tables (`Products` and `ProductsChangeLog`). The function uses data provided in an HTTP POST request as a JSON body and multiple output bindings.
9898

@@ -163,7 +163,7 @@ namespace Microsoft.Azure.WebJobs.Extensions.Kusto.Samples.OutputBindingSamples
163163

164164
<a id="http-trigger-write-records-using-iasynccollector-c"></a>
165165

166-
### HTTP trigger, write records using IAsyncCollector
166+
#### HTTP trigger, write records using IAsyncCollector
167167

168168
The following example shows a [C# function](functions-dotnet-class-library.md) that ingests a set of records to a table. The function uses data provided in an HTTP POST body JSON array.
169169

@@ -204,7 +204,7 @@ namespace Microsoft.Azure.WebJobs.Extensions.Kusto.Samples.OutputBindingSamples
204204
}
205205
```
206206

207-
# [Isolated process](#tab/isolated-process)
207+
### [Isolated process](#tab/isolated-process)
208208

209209
More samples for the Azure Data Explorer output binding are available in the [GitHub repository](https://github.com/Azure/Webjobs.Extensions.Kusto/tree/main/samples/samples-outofproc).
210210

@@ -235,7 +235,7 @@ public class Product
235235

236236
<a id="http-trigger-write-one-record-c-oop"></a>
237237

238-
### HTTP trigger, write one record
238+
#### HTTP trigger, write one record
239239

240240
The following example shows a [C# function](functions-dotnet-class-library.md) that adds a record to a database. The function uses data provided in an HTTP POST request as a JSON body.
241241

@@ -265,7 +265,7 @@ namespace Microsoft.Azure.WebJobs.Extensions.Kusto.SamplesOutOfProc.OutputBindin
265265

266266
<a id="http-trigger-write-records-with-mapping-oop"></a>
267267

268-
### HTTP trigger, write records with mapping
268+
#### HTTP trigger, write records with mapping
269269

270270
The following example shows a [C# function](functions-dotnet-class-library.md) that adds a collection of records to a database. The function uses mapping that transforms a `Product` to `Item`.
271271

@@ -316,6 +316,7 @@ namespace Microsoft.Azure.WebJobs.Extensions.Kusto.SamplesOutOfProc.OutputBindin
316316
}
317317
}
318318
```
319+
---
319320

320321
::: zone-end
321322

articles/azure-functions/functions-bindings-event-grid-output.md

Lines changed: 63 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Azure Event Grid output binding for Azure Functions
33
description: Learn to send an Event Grid event in Azure Functions.
44

55
ms.topic: reference
6-
ms.date: 08/10/2023
6+
ms.date: 09/22/2023
77
ms.devlang: csharp, java, javascript, powershell, python
88
ms.custom: devx-track-csharp, fasttrack-edit, devx-track-python, devx-track-extended-java, devx-track-js
99
zone_pivot_groups: programming-languages-set-functions
@@ -114,7 +114,7 @@ public static EventGridEvent Run([TimerTrigger("0 */5 * * * *")] TimerInfo myTim
114114
}
115115
```
116116

117-
It is also possible to use an `out` parameter to accomplish the same thing:
117+
It's also possible to use an `out` parameter to accomplish the same thing:
118118
```csharp
119119
[FunctionName("EventGridOutput")]
120120
[return: EventGrid(TopicEndpointUri = "MyEventGridTopicUriSetting", TopicKeySetting = "MyEventGridTopicKeySetting")]
@@ -144,7 +144,7 @@ public static async Task Run(
144144
}
145145
```
146146

147-
Starting in version 3.3.0, it is possible to use Azure Active Directory when authenticating the output binding:
147+
Starting in version 3.3.0, it's possible to use Azure Active Directory when authenticating the output binding:
148148

149149
```csharp
150150
[FunctionName("EventGridAsyncOutput")]
@@ -161,19 +161,16 @@ public static async Task Run(
161161
}
162162
```
163163

164-
When using the Connection property, the `topicEndpointUri` must be specified as a child of the connection setting, and the `TopicEndpointUri` and `TopicKeySetting` properties should not be used. For local development, use the local.settings.json file to store the connection information:
164+
When you use the `Connection` property, the `topicEndpointUri` must be specified as a child of the connection setting, and you shouldn't use the `TopicEndpointUri` and `TopicKeySetting` properties. For local development, use the local.settings.json file to store the connection information:
165+
165166
```json
166167
{
167168
"Values": {
168169
"myConnection__topicEndpointUri": "{topicEndpointUri}"
169170
}
170171
}
171172
```
172-
When deployed, use the application settings to store this information.
173-
174-
## Authenticating the Event Grid output binding
175-
176-
[!INCLUDE [functions-event-grid-connections](../../includes/functions-event-grid-connections.md)]
173+
When deployed, you must add this same information to application settings for the function app. For more information, see [Identity-based authentication](#identity-based-authentication).
177174

178175
# [Isolated process](#tab/isolated-process)
179176

@@ -296,7 +293,7 @@ To output multiple events, return an array instead of a single object. For examp
296293

297294
# [Model v3](#tab/nodejs-v3)
298295

299-
TypeScript samples are not documented for model v3.
296+
TypeScript samples aren't documented for model v3.
300297

301298
---
302299

@@ -536,6 +533,7 @@ The following table explains the parameters for the `EventGridAttribute`.
536533
|---------|---------|----------------------|
537534
|**TopicEndpointUri** | The name of an app setting that contains the URI for the custom topic, such as `MyTopicEndpointUri`. |
538535
|**TopicKeySetting** | The name of an app setting that contains an access key for the custom topic. |
536+
|**Connection**<sup>*</sup> | The value of the common prefix for the setting that contains the topic endpoint URI. For more information about the naming format of this application setting, see [Identity-based authentication](#identity-based-authentication). |
539537

540538
# [Isolated process](#tab/isolated-process)
541539

@@ -545,6 +543,7 @@ The following table explains the parameters for the `EventGridOutputAttribute`.
545543
|---------|---------|----------------------|
546544
|**TopicEndpointUri** | The name of an app setting that contains the URI for the custom topic, such as `MyTopicEndpointUri`. |
547545
|**TopicKeySetting** | The name of an app setting that contains an access key for the custom topic. |
546+
|**connection**<sup>*</sup> | The value of the common prefix for the setting that contains the topic endpoint URI. For more information about the naming format of this application setting, see [Identity-based authentication](#identity-based-authentication). |
548547

549548
---
550549

@@ -589,6 +588,7 @@ The following table explains the binding configuration properties that you set i
589588
|**name** | The variable name used in function code that represents the event. |
590589
|**topicEndpointUri** | The name of an app setting that contains the URI for the custom topic, such as `MyTopicEndpointUri`. |
591590
|**topicKeySetting** | The name of an app setting that contains an access key for the custom topic. |
591+
|**connection**<sup>*</sup> | The value of the common prefix for the setting that contains the topic endpoint URI. For more information about the naming format of this application setting, see [Identity-based authentication](#identity-based-authentication). |
592592

593593
---
594594

@@ -605,13 +605,16 @@ The following table explains the binding configuration properties that you set i
605605
|**name** | The variable name used in function code that represents the event. |
606606
|**topicEndpointUri** | The name of an app setting that contains the URI for the custom topic, such as `MyTopicEndpointUri`. |
607607
|**topicKeySetting** | The name of an app setting that contains an access key for the custom topic. |
608+
|**connection**<sup>*</sup> | The value of the common prefix for the setting that contains the topic endpoint URI. For more information about the naming format of this application setting, see [Identity-based authentication](#identity-based-authentication). |
608609

609610
::: zone-end
610-
611+
::: zone pivot="programming-language-csharp,programming-language-javascript,programming-language-powershell,programming-language-python,programming-language-typescript"
612+
<sup>*</sup>Support for identity-based connections requires version 3.3.x or higher of the extension.
613+
::: zone-end
611614
[!INCLUDE [app settings to local.settings.json](../../includes/functions-app-settings-local.md)]
612615

613616
> [!IMPORTANT]
614-
> Make sure that you set the value of the `TopicEndpointUri` configuration property to the name of an app setting that contains the URI of the custom topic. Don't specify the URI of the custom topic directly in this property.
617+
> Make sure that you set the value of `TopicEndpointUri` to the name of an app setting that contains the URI of the custom topic. Don't specify the URI of the custom topic directly in this property. The same applies when using `Connection`.
615618

616619
See the [Example section](#example) for complete examples.
617620

@@ -625,7 +628,7 @@ The parameter type supported by the Event Grid output binding depends on the Fun
625628
In-process C# class library functions supports the following types:
626629

627630
+ [Azure.Messaging.CloudEvent][CloudEvent]
628-
+ [Azure.Messaging.EventGrid][EventGridEvent2]
631+
+ [Azure.Messaging.EventGrid.EventGridEvent][EventGridEvent2]
629632
+ [Newtonsoft.Json.Linq.JObject][JObject]
630633
+ [System.String][String]
631634

@@ -696,9 +699,55 @@ There are two options for outputting an Event Grid message from a function:
696699

697700
::: zone-end
698701

702+
## Connections
703+
704+
There are two ways of authenticating to an Event Grid topic when using the Event Grid output binding:
705+
706+
| Authentication method | Description |
707+
| ----- | ----- |
708+
| Using a topic key | Set the `TopicEndpointUri` and `TopicKeySetting` properties, as described in [Use a topic key](#use-a-topic-key). |
709+
| Using an identity | Set the `Connection` property to the name of a shared prefix for multiple application settings, together defining [identity-based authentication](#identity-based-authentication). This method is supported when using version 3.3.x or higher of the extension. |
710+
711+
### Use a topic key
712+
713+
Use the following steps to configure a topic key:
714+
715+
1. Follow the steps in [Get access keys](../event-grid/get-access-keys.md) to obtain the topic key for your Event Grid topic.
716+
717+
1. In your application settings, create a setting that defines the topic key value. Use the name of this setting for the `TopicKeySetting` property of the binding.
718+
719+
1. In your application settings, create a setting that defines the topic endpoint. Use the name of this setting for the `TopicEndpointUri` property of the binding.
720+
721+
### Identity-based authentication
722+
723+
When using version 3.3.x or higher of the extension, you can connect to an Event Grid topic using an [Azure Active Directory identity](../active-directory/fundamentals/active-directory-whatis.md) to avoid having to obtain and work with topic keys.
724+
725+
To do this, create an application setting that returns the topic endpoint URI, where the name of the setting combines a unique _common prefix_, such as `myawesometopic`, with the value `__topicEndpointUri`. You then use the common prefix `myawesometopic` when you define the `Connection` property in the binding.
726+
727+
In this mode, the extension requires the following properties:
728+
729+
| Property | Environment variable template | Description | Example value |
730+
|--------------------|----------------------------------------------|---------------------|---------------|
731+
| Topic Endpoint URI | `<CONNECTION_NAME_PREFIX>__topicEndpointUri` | The topic endpoint. | `https://<topic-name>.centralus-1.eventgrid.azure.net/api/events` |
732+
733+
More properties may be set to customize the connection. See [Common properties for identity-based connections](functions-reference.md#common-properties-for-identity-based-connections).
734+
735+
> [!NOTE]
736+
> When using [Azure App Configuration](../azure-app-configuration/quickstart-azure-functions-csharp.md) or [Key Vault](../key-vault/general/overview.md) to provide settings for managed identity-based connections, setting names should use a valid key separator such as `:` or `/` in place of the `__` to ensure names are resolved correctly.
737+
>
738+
> For example, `<CONNECTION_NAME_PREFIX>:topicEndpointUri`.
739+
740+
[!INCLUDE [functions-identity-based-connections-configuration](../../includes/functions-identity-based-connections-configuration.md)]
741+
742+
[!INCLUDE [functions-event-grid-permissions](../../includes/functions-event-grid-permissions.md)]
743+
744+
699745
## Next steps
700746

701747
* [Dispatch an Event Grid event](./functions-bindings-event-grid-trigger.md)
702748

703-
[EventGridEvent]: /dotnet/api/azure.messaging.eventgrid.eventgridevent
749+
[EventGridEvent2]: /dotnet/api/azure.messaging.eventgrid.eventgridevent
750+
[EventGridEvent]: /dotnet/api/microsoft.azure.eventgrid.models.eventgridevent
704751
[CloudEvent]: /dotnet/api/azure.messaging.cloudevent
752+
[String]: /dotnet/api/system.string
753+
[JObject]: https://www.newtonsoft.com/json/help/html/t_newtonsoft_json_linq_jobject.htm

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ public static void Run([TimerTrigger("0 */5 * * * *")]TimerInfo myTimer, ILogger
6565

6666
:::code language="csharp" source="~/azure-functions-dotnet-worker/samples/Extensions/Timer/TimerFunction.cs" range="11-17":::
6767

68+
---
6869

6970
::: zone-end
7071
::: zone pivot="programming-language-java"

articles/azure-functions/functions-reference.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ Choose one of these tabs to learn about permissions for each component:
226226

227227
# [Event Grid extension](#tab/eventgrid)
228228

229-
[!INCLUDE [functions-event-grid-connections](../../includes/functions-event-grid-connections.md)]
229+
[!INCLUDE [functions-event-grid-permissions](../../includes/functions-event-grid-permissions.md)]
230230

231231
# [Azure Cosmos DB extension](#tab/cosmos)
232232

articles/azure-functions/migrate-cosmos-db-version-3-version-4.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ This article walks you through the process of migrating your function app to run
3030

3131
Update your `.csproj` project file to use the latest extension version for your process model. The following `.csproj` file uses version 4 of the Azure Cosmos DB extension.
3232

33-
### [In-process model](#tab/in-process)
33+
### [In-process](#tab/in-process)
3434

3535
```xml
3636
<Project Sdk="Microsoft.NET.Sdk">
@@ -54,7 +54,7 @@ Update your `.csproj` project file to use the latest extension version for your
5454
</Project>
5555
```
5656

57-
### [Isolated worker model](#tab/isolated-worker)
57+
### [Isolated process](#tab/isolated-process)
5858

5959
```xml
6060
<Project Sdk="Microsoft.NET.Sdk">

includes/functions-event-grid-connections.md

Lines changed: 0 additions & 41 deletions
This file was deleted.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
author: ggailey777
3+
ms.service: azure-functions
4+
ms.topic: include
5+
ms.date: 09/29/2023
6+
ms.author: glenga
7+
---
8+
9+
You must create a role assignment that provides access to your Event Grid topic at runtime. Management roles like [Owner](../articles/role-based-access-control/built-in-roles.md#owner) are not sufficient. The following table shows built-in roles that are recommended when using the Event Hubs extension in normal operation. Your application may require additional permissions based on the code you write.
10+
11+
| Binding type | Example built-in roles |
12+
|----------------|-----------------------------------------------------------------|
13+
| Output binding | [EventGrid Contributor](../articles/role-based-access-control//built-in-roles.md#eventgrid-contributor), [EventGrid Data Sender](../articles/role-based-access-control/built-in-roles.md#eventgrid-data-sender) |

includes/functions-event-hubs-connections.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ If you are using [version 5.x or higher of the extension](../articles/azure-func
2929

3030
In this mode, the extension requires the following properties:
3131

32-
| Property | Environment variable template | Description | Example value |
33-
|---------------------------|-----------------------------------------------------|--------------------------------------------|------------------------------------------------|
34-
| Fully Qualified Namespace | `<CONNECTION_NAME_PREFIX>__fullyQualifiedNamespace` | The fully qualified Event Hubs namespace. | <event_hubs_namespace>.servicebus.windows.net |
32+
| Property | Environment variable template | Description | Example value |
33+
|--------------|----------|-----|----------|
34+
| Fully Qualified Namespace | `<CONNECTION_NAME_PREFIX>__fullyQualifiedNamespace` | The fully qualified Event Hubs namespace. | `myeventhubns.servicebus.windows.net`|
3535

3636
Additional properties may be set to customize the connection. See [Common properties for identity-based connections](../articles/azure-functions/functions-reference.md#common-properties-for-identity-based-connections).
3737

0 commit comments

Comments
 (0)