Skip to content

Commit a437fec

Browse files
committed
Updating EventGrid outputs and warmup docs
1 parent b4a5746 commit a437fec

File tree

2 files changed

+73
-11
lines changed

2 files changed

+73
-11
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -576,6 +576,7 @@ The following table explains the properties that you can set on the `options` ob
576576
|---------|---------|----------------------|
577577
|**topicEndpointUri** | The name of an app setting that contains the URI for the custom topic, such as `MyTopicEndpointUri`. |
578578
|**topicKeySetting** | The name of an app setting that contains an access key for the custom topic. |
579+
|**connection**<sup>*</sup> | The value of the common prefix for the setting that contains the topic endpoint URI. When setting the `connection` property, the `topicEndpointUri` and `topicKeySetting` properties should not be set. For more information about the naming format of this application setting, see [Identity-based authentication](#identity-based-authentication). |
579580

580581
# [Model v3](#tab/nodejs-v3)
581582

@@ -588,7 +589,7 @@ The following table explains the binding configuration properties that you set i
588589
|**name** | The variable name used in function code that represents the event. |
589590
|**topicEndpointUri** | The name of an app setting that contains the URI for the custom topic, such as `MyTopicEndpointUri`. |
590591
|**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). |
592+
|**connection**<sup>*</sup> | The value of the common prefix for the setting that contains the topic endpoint URI. When setting the `connection` property, the `topicEndpointUri` and `topicKeySetting` properties should not be set. For more information about the naming format of this application setting, see [Identity-based authentication](#identity-based-authentication). |
592593

593594
---
594595

@@ -722,7 +723,7 @@ Use the following steps to configure a topic key:
722723

723724
When using version 3.3.x or higher of the extension, you can connect to an Event Grid topic using an [Microsoft Entra identity](../active-directory/fundamentals/active-directory-whatis.md) to avoid having to obtain and work with topic keys.
724725

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+
To do this, create an application setting that returns the topic endpoint URI. The name of the setting should combine a _unique common prefix_ (for example, `myawesometopic`) with the value `__topicEndpointUri`. Then, you must use that common prefix (in this case, `myawesometopic`) when you define the `Connection` property in the binding.
726727

727728
In this mode, the extension requires the following properties:
728729

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

Lines changed: 70 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ms.topic: reference
77
ms.devlang: csharp, java, javascript, python
88
ms.custom: devx-track-csharp, devx-track-extended-java, devx-track-js, devx-track-python
99
ms.date: 09/04/2023
10-
zone_pivot_groups: programming-languages-set-functions-lang-workers
10+
zone_pivot_groups: programming-languages-set-functions
1111
---
1212

1313
# Azure Functions warmup trigger
@@ -80,7 +80,23 @@ public void warmup( @WarmupTrigger Object warmupContext, ExecutionContext contex
8080
```
8181

8282
::: zone-end
83-
::: zone pivot="programming-language-javascript"
83+
::: zone pivot="programming-language-javascript"
84+
85+
# [Model v4](#tab/nodejs-v4)
86+
87+
The following example shows a warmup trigger [JavaScript function](functions-reference-node.md) that runs on each new instance when it's added to your app.
88+
89+
```javascript
90+
import { app } from "@azure/functions";
91+
92+
app.warmup('warmupTrigger1', {
93+
handler: (warmupContext, context) => {
94+
context.log('Function App instance is warm.');
95+
},
96+
});
97+
```
98+
99+
# [Model v3](#tab/nodejs-v3)
84100

85101
The following example shows a warmup trigger in a *function.json* file and a [JavaScript function](functions-reference-node.md) that runs on each new instance when it's added to your app.
86102

@@ -102,13 +118,34 @@ The [configuration](#configuration) section explains these properties.
102118

103119
Here's the JavaScript code:
104120

105-
```javascript
106-
module.exports = async function (context, warmupContext) {
121+
```JavaScript
122+
module.exports = async function (warmupContext, context) {
107123
context.log('Function App instance is warm.');
108124
};
109125
```
110126

111-
::: zone-end
127+
::: zone-end
128+
::: zone pivot="programming-language-typescript"
129+
# [Model v4](#tab/nodejs-v4)
130+
131+
The following example shows a warmup trigger [JavaScript function](functions-reference-node.md) that runs on each new instance when it's added to your app.
132+
133+
```TypeScript
134+
import { app, InvocationContext, WarmupContextOptions } from "@azure/functions";
135+
136+
export async function warmupFunction(warmupContext: WarmupContextOptions, context: InvocationContext): Promise<void> {
137+
context.log('Function App instance is warm.');
138+
}
139+
140+
app.warmup('warmup', {
141+
handler: warmupFunction,
142+
});
143+
```
144+
145+
# [Model v3](#tab/nodejs-v3)
146+
TypeScript samples are not documented for model v3.
147+
148+
::: zone-end
112149
::: zone pivot="programming-language-powershell"
113150
Here's the *function.json* file:
114151

@@ -184,9 +221,15 @@ Use the `WarmupTrigger` attribute to define the function. This attribute has no
184221
Annotations aren't required by a warmup trigger. Just use a name of `warmup` (case-insensitive) for the `FunctionName` annotation.
185222

186223
::: zone-end
187-
::: zone pivot="programming-language-javascript,programming-language-powershell,programming-language-python"
224+
::: zone pivot="programming-language-javascript,programming-language-typescript"
188225
## Configuration
189226

227+
# [Model v4](#tab/nodejs-v4)
228+
229+
There are no additional properties that need to be set on the `options` object passed to the `app.warmup()` method.
230+
231+
# [Model v3](#tab/nodejs-v3)
232+
190233
The following table explains the binding configuration properties that you set in the *function.json* file.
191234

192235
|function.json property |Description|
@@ -195,7 +238,19 @@ The following table explains the binding configuration properties that you set i
195238
| **direction** | Required - must be set to `in`. |
196239
| **name** | Required - the variable name used in function code. A `name` of `warmupContext` is recommended for the binding parameter.|
197240

198-
::: zone-end
241+
::: zone-end
242+
::: zone pivot="programming-language-powershell,programming-language-python"
243+
## Configuration
244+
245+
The following table explains the binding configuration properties that you set in the *function.json* file.
246+
247+
|function.json property |Description|
248+
|---------|----------------------|
249+
| **type** | Required - must be set to `warmupTrigger`. |
250+
| **direction** | Required - must be set to `in`. |
251+
| **name** | Required - the variable name used in function code. A `name` of `warmupContext` is recommended for the binding parameter.|
252+
253+
::: zone-end
199254

200255
See the [Example section](#example) for complete examples.
201256

@@ -223,8 +278,14 @@ The following considerations apply to using a warmup function in C#:
223278
::: zone-end
224279
::: zone pivot="programming-language-java"
225280
Your function must be named `warmup` (case-insensitive) using the `FunctionName` annotation.
226-
::: zone-end
227-
::: zone pivot="programming-language-javascript,programming-language-powershell,programming-language-python"
281+
::: zone-end
282+
::: zone pivot="programming-language-javascript,programming-language-typescript"
283+
# [Model v4](#tab/nodejs-v4)
284+
Please see the list of considerations at the top of the page for general usage advice.
285+
# [Model v3](#tab/nodejs-v3)
286+
The function type in _function.json_ must be set to `warmupTrigger`.
287+
::: zone-end
288+
::: zone pivot="programming-language-powershell,programming-language-python"
228289
The function type in function.json must be set to `warmupTrigger`.
229290
::: zone-end
230291

0 commit comments

Comments
 (0)