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/functions-api-definition.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
@@ -16,6 +16,9 @@ ms.author: alkarche
16
16
# OpenAPI 2.0 metadata support in Azure Functions (preview)
17
17
OpenAPI 2.0 (formerly Swagger) metadata support in Azure Functions is a preview feature that you can use to write an OpenAPI 2.0 definition inside a function app. You can then host that file by using the function app.
18
18
19
+
> [!IMPORTANT]
20
+
> The OpenAPI preview feature is only available today in the 1.x runtime. Information on how to create a 1.x function app [can be found here](./functions-versions.md#creating-1x-apps).
21
+
19
22
[OpenAPI metadata](http://swagger.io/) allows a function that's hosting a REST API to be consumed by a wide variety of other software. This software includes Microsoft offerings like PowerApps and the [API Apps feature of Azure App Service](../app-service/app-service-web-overview.md), third-party developer tools like [Postman](https://www.getpostman.com/docs/importing_swagger), and [many more packages](http://swagger.io/tools/).
> For performance and experience, it is recommended to use APPINSIGHTS_INSTRUMENTATIONKEY and App Insights for monitoring instead of AzureWebJobsDashboard
41
+
39
42
## AzureWebJobsDisableHomepage
40
43
41
44
`true` means disable the default landing page that is shown for the root URL of a function app. Default is `false`.
@@ -106,11 +109,19 @@ Valid values are "readwrite" and "readonly".
106
109
107
110
## FUNCTIONS\_EXTENSION\_VERSION
108
111
109
-
The version of the Azure Functions runtime to use in this function app. A tilde with major version means use the latest version of that major version (for example, "~1"). When new versions for the same major version are available, they are automatically installed in the function app. To pin the app to a specific version, use the full version number (for example, "1.0.12345"). Default is "~1".
112
+
The version of the Azure Functions runtime to use in this function app. A tilde with major version means use the latest version of that major version (for example, "~2"). When new versions for the same major version are available, they are automatically installed in the function app. To pin the app to a specific version, use the full version number (for example, "2.0.12345"). Default is "~2".
113
+
114
+
|Key|Sample value|
115
+
|---|------------|
116
+
|FUNCTIONS\_EXTENSION\_VERSION|~2|
117
+
118
+
## FUNCTIONS\_WORKER\_RUNTIME
119
+
120
+
The language worker runtime to load in the function app. This will correspond to the language being used in your application (for example, "dotnet"). For functions in multiple languages you will need to publish them to multiple apps, each with a corresponding worker runtime value. Valid values are `dotnet`, `node`, and `java`.
110
121
111
122
|Key|Sample value|
112
123
|---|------------|
113
-
|FUNCTIONS\_EXTENSION\_VERSION|~1|
124
+
|FUNCTIONS\_WORKER\_RUNTIME|dotnet|
114
125
115
126
## WEBSITE_CONTENTAZUREFILECONNECTIONSTRING
116
127
@@ -133,19 +144,19 @@ For consumption plans only. The file path to the function app code and configura
133
144
The maximum number of instances that the function app can scale out to. Default is no limit.
134
145
135
146
> [!NOTE]
136
-
> This setting is for a preview feature.
147
+
> This setting is a preview feature - and only reliable if set to a value <= 5
Copy file name to clipboardExpand all lines: articles/azure-functions/functions-best-practices.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -73,6 +73,10 @@ Take advantage of defensive measures already provided for components you use in
73
73
74
74
There are a number of factors which impact how instances of your function app scale. The details are provided in the documentation for [function scaling](functions-scale.md). The following are some best practices to ensure optimal scalability of a function app.
75
75
76
+
### Share and manage connections
77
+
78
+
Re-use connections to external resources whenever possible. See [how to manage connections in Azure Functions](./manage-connections.md).
79
+
76
80
### Don't mix test and production code in the same function app
77
81
78
82
Functions within a function app share resources. For example, memory is shared. If you're using a function app in production, don't add test-related functions and resources to it. It can cause unexpected overhead during production code execution.
This article explains how to work with [Azure Cosmos DB](..\cosmos-db\serverless-computing-database.md) bindings in Azure Functions 2.x. Azure Functions supports trigger, input, and output bindings for Azure Cosmos DB.
24
24
25
25
> [!NOTE]
26
-
> This article is for [Azure Functions version 2.x](functions-versions.md), which is in Preview. For information about how to use these bindings in Functions 1.x, see [Azure Cosmos DB bindings for Azure Functions 1.x](functions-bindings-cosmosdb.md).
26
+
> This article is for [Azure Functions version 2.x](functions-versions.md). For information about how to use these bindings in Functions 1.x, see [Azure Cosmos DB bindings for Azure Functions 1.x](functions-bindings-cosmosdb.md).
27
27
>
28
28
> This binding was originally named DocumentDB. In Functions version 2.x, the trigger, bindings, and package are all named Cosmos DB.
The following example shows an event hub trigger binding in a *function.json* file and a [C# script function](functions-reference-csharp.md) that uses the binding. The function logs the message body of the event hub trigger.
127
127
128
-
The following examples show Event Hubs binding data in the *function.json* file. The first example is for Functions 1.x, and the second one is for Functions 2.x.
128
+
The following examples show Event Hubs binding data in the *function.json* file. The first example is for Functions 2.x, and the second one is for Functions 1.x.
The following example shows an event hub trigger binding in a *function.json* file and an [F# function](functions-reference-fsharp.md) that uses the binding. The function logs the message body of the event hub trigger.
201
202
202
-
The following examples show Event Hubs binding data in the *function.json* file. The first example is for Functions 1.x, and the second one is for Functions 2.x.
203
+
The following examples show Event Hubs binding data in the *function.json* file. The first example is for Functions 2.x, and the second one is for Functions 1.x.
@@ -231,14 +233,15 @@ let Run(myEventHubMessage: string, log: TraceWriter) =
231
233
232
234
The following example shows an event hub trigger binding in a *function.json* file and a [JavaScript function](functions-reference-node.md) that uses the binding. The function reads [event metadata](#trigger---event-metadata) and logs the message.
233
235
234
-
The following examples show Event Hubs binding data in the *function.json* file. The first example is for Functions 1.x, and the second one is for Functions 2.x.
236
+
The following examples show Event Hubs binding data in the *function.json* file. The first example is for Functions 2.x, and the second one is for Functions 1.x.
@@ -265,14 +268,14 @@ module.exports = function (context, eventHubMessage) {
265
268
};
266
269
```
267
270
268
-
To receive events in a batch, set `cardinality` to `many` in the *function.json* file, as shown in the following examples. The first example is for Functions 1.x, and the second one is for Functions 2.x.
271
+
To receive events in a batch, set `cardinality` to `many` in the *function.json* file, as shown in the following examples. The first example is for Functions 2.x, and the second one is for Functions 1.x.
The following example shows an event hub trigger binding in a *function.json* file and a [C# script function](functions-reference-csharp.md) that uses the binding. The function writes a message to an event hub.
424
427
425
-
The following examples show Event Hubs binding data in the *function.json* file. The first example is for Functions 1.x, and the second one is for Functions 2.x.
428
+
The following examples show Event Hubs binding data in the *function.json* file. The first example is for Functions 2.x, and the second one is for Functions 1.x.
426
429
427
430
```json
428
431
{
429
432
"type": "eventHub",
430
433
"name": "outputEventHubMessage",
431
-
"path": "myeventhub",
434
+
"eventHubName": "myeventhub",
432
435
"connection": "MyEventHubSendAppSetting",
433
436
"direction": "out"
434
437
}
@@ -437,7 +440,7 @@ The following examples show Event Hubs binding data in the *function.json* file.
The following example shows an event hub trigger binding in a *function.json* file and an [F# function](functions-reference-fsharp.md) that uses the binding. The function writes a message to an event hub.
474
477
475
-
The following examples show Event Hubs binding data in the *function.json* file. The first example is for Functions 1.x, and the second one is for Functions 2.x.
478
+
The following examples show Event Hubs binding data in the *function.json* file. The first example is for Functions 2.x, and the second one is for Functions 1.x.
476
479
477
480
```json
478
481
{
479
482
"type": "eventHub",
480
483
"name": "outputEventHubMessage",
481
-
"path": "myeventhub",
484
+
"eventHubName": "myeventhub",
482
485
"connection": "MyEventHubSendAppSetting",
483
486
"direction": "out"
484
487
}
@@ -487,7 +490,7 @@ The following examples show Event Hubs binding data in the *function.json* file.
The following example shows an event hub trigger binding in a *function.json* file and a [JavaScript function](functions-reference-node.md) that uses the binding. The function writes a message to an event hub.
508
511
509
-
The following examples show Event Hubs binding data in the *function.json* file. The first example is for Functions 1.x, and the second one is for Functions 2.x.
512
+
The following examples show Event Hubs binding data in the *function.json* file. The first example is for Functions 2.x, and the second one is for Functions 1.x.
510
513
511
514
```json
512
515
{
513
516
"type": "eventHub",
514
517
"name": "outputEventHubMessage",
515
-
"path": "myeventhub",
518
+
"eventHubName": "myeventhub",
516
519
"connection": "MyEventHubSendAppSetting",
517
520
"direction": "out"
518
521
}
@@ -521,7 +524,7 @@ The following examples show Event Hubs binding data in the *function.json* file.
0 commit comments